/** * Copies the values of the order address item into the address item. * * @param MShop_Order_Item_Base_Address_Interface $item Order address item */ public function copyFrom(MShop_Order_Item_Base_Address_Interface $item) { $this->setCompany($item->getCompany()); $this->setVatID($item->getVatID()); $this->setSalutation($item->getSalutation()); $this->setTitle($item->getTitle()); $this->setFirstname($item->getFirstname()); $this->setLastname($item->getLastname()); $this->setAddress1($item->getAddress1()); $this->setAddress2($item->getAddress2()); $this->setAddress3($item->getAddress3()); $this->setPostal($item->getPostal()); $this->setCity($item->getCity()); $this->setState($item->getState()); $this->setCountryId($item->getCountryId()); $this->setLanguageId($item->getLanguageId()); $this->setTelephone($item->getTelephone()); $this->setTelefax($item->getTelefax()); $this->setEmail($item->getEmail()); $this->setWebsite($item->getWebsite()); $this->setFlag($item->getFlag()); }
/** * Adds a single address item to the address list of the XML object * * @param MShop_Order_Item_Base_Address_Interface $address Address object with personal information * @param DOMDocument $dom DOM document object with contains the XML structure * @param DOMElement $addresslist DOM element which will be the parent of the new child * @throws DOMException If an error occures */ protected function _buildXMLAddress(MShop_Order_Item_Base_Address_Interface $address, DOMDocument $dom, DOMElement $addresslist) { $addressitem = $dom->createElement('addressitem'); $this->_appendChildCDATA('type', $address->getType(), $dom, $addressitem); $this->_appendChildCDATA('salutation', $address->getSalutation(), $dom, $addressitem); $this->_appendChildCDATA('title', $address->getTitle(), $dom, $addressitem); $this->_appendChildCDATA('firstname', $address->getFirstname(), $dom, $addressitem); $this->_appendChildCDATA('lastname', $address->getLastname(), $dom, $addressitem); $this->_appendChildCDATA('company', $address->getCompany(), $dom, $addressitem); $this->_appendChildCDATA('address1', $address->getAddress1(), $dom, $addressitem); $this->_appendChildCDATA('address2', $address->getAddress2(), $dom, $addressitem); $this->_appendChildCDATA('address3', $address->getAddress3(), $dom, $addressitem); $this->_appendChildCDATA('postalcode', $address->getPostal(), $dom, $addressitem); $this->_appendChildCDATA('city', $address->getCity(), $dom, $addressitem); $this->_appendChildCDATA('state', $address->getState(), $dom, $addressitem); $this->_appendChildCDATA('countrycode', strtoupper($address->getCountryId()), $dom, $addressitem); $this->_appendChildCDATA('email', $address->getEmail(), $dom, $addressitem); $this->_appendChildCDATA('phone', $address->getTelephone(), $dom, $addressitem); $this->_appendChildCDATA('vatid', $address->getVatID(), $dom, $addressitem); $addresslist->appendChild($addressitem); }