public function setAddress( MShop_Order_Item_Base_Address_Interface $address,
		$domain = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT )
	{
		if ( isset( $this->_addresses[ $domain ] ) && $this->_addresses[ $domain ] === $address ) { return; }

		$this->_notifyListeners( 'setAddress.before', $address );

		// enforce that the type is the same as the given one
		$address->setType( $domain );

		$this->_addresses[$domain] = clone $address;
		$this->_modified = true;

		$this->_notifyListeners( 'setAddress.after', $address );

		return $this->_addresses[$domain];
	}
public function setAddress( MShop_Order_Item_Base_Address_Interface $address,
		$domain = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT )
	{
		if ( isset( $this->_addresses[ $domain ] ) && $this->_addresses[ $domain ] === $address ) { return; }

		$this->_notifyListeners( 'setAddress.before', $address );

		// enforce that the type is the same as the given one
		$address->setType( $domain );

		$this->_addresses[$domain] = clone $address;
		$this->_modified = true;

		$this->_notifyListeners( 'setAddress.after', $address );

		return $this->_addresses[$domain];
	}
public function setAddress ( MShop_Order_Item_Base_Address_Interface $ address , $ domain = MShop_Order_Item_Base_Address_Abstract :: TYPE_PAYMENT ) { if ( isset ( $ this -> _addresses [ $ domain ] ) && $ this -> _addresses [ $ domain ] === $ address ) { return ; } $ this -> _notifyListeners ( 'setAddress.before' , $ address ) ; // enforce that the type is the same as the given one $ address -> setType ( $ domain ) ; $ this -> _addresses [ $ domain ] = clone $ address ; $ this -> _modified = true ; $ this -> _notifyListeners ( 'setAddress.after' , $ address ) ; return $ this -> _addresses [ $ domain ] ; }
Sets a customer address as billing or delivery address for an order.

@param MShop_Order_Item_Base_Address_Interface $address Order address item for the given domain
@param string $domain Address domain, usually "billing" or "delivery"
@return MShop_Order_Item_Base_Address_Interface Item that was really added to the basket
Sets a customer address as billing or delivery address for an order .