Example #1
0
 /**
  * Adds a single address item to the address list of the XML object
  *
  * @param \Aimeos\MShop\Order\Item\Base\Address\Iface $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(\Aimeos\MShop\Order\Item\Base\Address\Iface $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);
 }