コード例 #1
0
 /**
  * build images/image nodes
  * @param EbayEnterprise_Dom_Element $item
  * @param array $imageData
  * @return self
  */
 protected function _buildImagesNodes(EbayEnterprise_Dom_Element $item, array $imageData)
 {
     $images = $item->createChild('Images');
     foreach ($imageData as $image) {
         $images->createChild('Image', null, ['imageview' => $image['view'], 'imagename' => $image['name'], 'imageurl' => $image['url'], 'imagewidth' => $image['width'], 'imageheight' => $image['height']]);
     }
     return $this;
 }
コード例 #2
0
 /**
  * Append the nodes necessary DOMNodes to represent the pim attribute to the
  * given EbayEnterprise_Dom_Element.
  * @param  EbayEnterprise_Dom_Element                     $itemNode     container node
  * @param  EbayEnterprise_Catalog_Model_Pim_Attribute $pimAttribute attribute value model
  * @return self
  */
 protected function _appendAttributeValue(EbayEnterprise_Dom_Element $itemNode, EbayEnterprise_Catalog_Model_Pim_Attribute $pimAttribute)
 {
     if ($pimAttribute->value instanceof DOMAttr) {
         $itemNode->setAttribute($pimAttribute->value->name, $pimAttribute->value->value);
     } elseif ($pimAttribute->value instanceof DOMNode) {
         $attributeNode = $itemNode->setNode($pimAttribute->destinationXpath);
         $attributeNode->appendChild($this->_doc->importNode($pimAttribute->value, true));
         if ($pimAttribute->language) {
             $attributeNode->addAttributes(array('xml:lang' => $pimAttribute->language));
         }
         $this->_clumpWithSimilar($attributeNode);
     }
     return $this;
 }