public function setAddress($type, $addr)
    {
        if (!($addr instanceof KlarnaAddr)) {
            throw new Klarna_InvalidKlarnaAddrException;
        }

        if ($addr->isCompany === null) {
            $addr->isCompany = false;
        }

        if ($type === KlarnaFlags::IS_SHIPPING) {
            $this->shipping = $addr;
            self::printDebug("shipping address array", $this->shipping);
            return;
        }

        if ($type === KlarnaFlags::IS_BILLING) {
            $this->billing = $addr;
            self::printDebug("billing address array", $this->billing);
            return;
        }
        throw new Klarna_UnknownAddressTypeException($type);
    }
public function setAddress($type, $addr)
    {
        if (!($addr instanceof KlarnaAddr)) {
            throw new Klarna_InvalidKlarnaAddrException;
        }

        if ($addr->isCompany === null) {
            $addr->isCompany = false;
        }

        if ($type === KlarnaFlags::IS_SHIPPING) {
            $this->shipping = $addr;
            self::printDebug("shipping address array", $this->shipping);
            return;
        }

        if ($type === KlarnaFlags::IS_BILLING) {
            $this->billing = $addr;
            self::printDebug("billing address array", $this->billing);
            return;
        }
        throw new Klarna_UnknownAddressTypeException($type);
    }
public function setAddress ( $ type , $ addr ) { if ( ! ( $ addr instanceof KlarnaAddr ) ) { throw new Klarna_InvalidKlarnaAddrException ; } if ( $ addr -> isCompany === null ) { $ addr -> isCompany = false ; } if ( $ type === KlarnaFlags :: IS_SHIPPING ) { $ this -> shipping = $ addr ; self :: printDebug ( "shipping address array" , $ this -> shipping ) ; return ; } if ( $ type === KlarnaFlags :: IS_BILLING ) { $ this -> billing = $ addr ; self :: printDebug ( "billing address array" , $ this -> billing ) ; return ; } throw new Klarna_UnknownAddressTypeException ( $ type ) ; }
Sets the specified address for the current order.

<b>Address type can be</b>:<br>
{@link KlarnaFlags::IS_SHIPPING}<br>
{@link KlarnaFlags::IS_BILLING}<br>

@param int        $type Address type.
@param KlarnaAddr $addr Specified address.

@throws KlarnaException
@return void
Sets the specified address for the current order .