@param Shopgate_Model_XmlResultObject $itemNode

@return Shopgate_Model_XmlResultObject
184966
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $imageNode
         */
        $imageNode = $itemNode->addChild('image');
        $imageNode->addAttribute('uid', $this->getUid());
        $imageNode->addAttribute('sort_order', $this->getSortOrder());
        $imageNode->addAttribute('is_cover', $this->getIsCover());
        $imageNode->addChildWithCDATA('url', $this->getUrl());
        $imageNode->addChildWithCDATA('title', $this->getTitle(), false);
        $imageNode->addChildWithCDATA('alt', $this->getAlt(), false);

        return $itemNode;
    }
162666
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $stockNode
         */
        $stockNode = $itemNode->addChild('stock');
        $stockNode->addChild('is_saleable', (int)$this->getIsSaleable());
        $stockNode->addChild('backorders', (int)$this->getBackorders());
        $stockNode->addChild('use_stock', (int)$this->getUseStock());
        $stockNode->addChild('stock_quantity', $this->getStockQuantity());
        $stockNode->addChild('minimum_order_quantity', $this->getMinimumOrderQuantity(), null, false);
        $stockNode->addChild('maximum_order_quantity', $this->getMaximumOrderQuantity(), null, false);
        $stockNode->addChildWithCDATA('availability_text', $this->getAvailabilityText(), false);

        return $itemNode;
    }
1102340
public function asXml(Shopgate_Model_XmlResultObject $itemsNode)
    {
        /**
         * global info
         *
         * @var $itemNode Shopgate_Model_XmlResultObject
         */
        $itemNode = $itemsNode->addChild(self::DEFAULT_ITEM_IDENTIFIER);

        $itemNode->addAttribute('uid', $this->getUid());
        $itemNode->addAttribute('last_update', $this->getLastUpdate());
        $itemNode->addChildWithCDATA('name', $this->getName());
        $itemNode->addChild('tax_percent', $this->getTaxPercent(), null, false);
        $itemNode->addChildWithCDATA('tax_class', $this->getTaxClass(), false);
        $itemNode->addChild('currency', $this->getCurrency());
        $itemNode->addChildWithCDATA('description', $this->getDescription());
        $itemNode->addChildWithCDATA('deeplink', $this->getDeeplink());
        $itemNode->addChild('promotion')->addAttribute('sort_order', $this->getPromotionSortOrder());
        $itemNode->addChildWithCDATA('internal_order_info', $this->getInternalOrderInfo());
        $itemNode->addChild('age_rating', $this->getAgeRating(), null, false);
        $itemNode->addChild('weight', $this->getWeight())->addAttribute('unit', $this->getWeightUnit());

        /**
         * is default child
         */
        if ($this->getIsChild()) {
            $itemNode->addAttribute('default_child', $this->getIsDefaultChild());
        }

        /**
         * prices / tier prices
         */
        $this->getPrice()->asXml($itemNode);

        /**
         * images
         *
         * @var Shopgate_Model_XmlResultObject $imagesNode
         * @var Shopgate_Model_Media_Image     $imageItem
         */
        $imagesNode = $itemNode->addChild('images');
        foreach ($this->getImages() as $imageItem) {
            $imageItem->asXml($imagesNode);
        }

        /**
         * categories
         *
         * @var Shopgate_Model_XmlResultObject      $categoryPathNode
         * @var Shopgate_Model_Catalog_CategoryPath $categoryPathItem
         */
        $categoryPathNode = $itemNode->addChild('categories');
        foreach ($this->getCategoryPaths() as $categoryPathItem) {
            $categoryPathItem->asXml($categoryPathNode);
        }

        /**
         * shipping
         */
        $this->getShipping()->asXml($itemNode);

        /**
         * manufacture
         */
        $this->getManufacturer()->asXml($itemNode);

        /**
         * visibility
         */
        $this->getVisibility()->asXml($itemNode);

        /**
         * properties
         *
         * @var Shopgate_Model_XmlResultObject  $propertiesNode
         * @var Shopgate_Model_Catalog_Property $propertyItem
         */
        $propertiesNode = $itemNode->addChild('properties');
        foreach ($this->getProperties() as $propertyItem) {
            $propertyItem->asXml($propertiesNode);
        }

        /**
         * stock
         */
        $this->getStock()->asXml($itemNode);

        /**
         * identifiers
         *
         * @var Shopgate_Model_XmlResultObject    $identifiersNode
         * @var Shopgate_Model_Catalog_Identifier $identifierItem
         */
        $identifiersNode = $itemNode->addChild('identifiers');
        foreach ($this->getIdentifiers() as $identifierItem) {
            $identifierItem->asXml($identifiersNode);
        }

        /**
         * tags
         *
         * @var Shopgate_Model_XmlResultObject $tagsNode
         * @var Shopgate_Model_Catalog_Tag     $tagItem
         */
        $tagsNode = $itemNode->addChild('tags');
        foreach ($this->getTags() as $tagItem) {
            $tagItem->asXml($tagsNode);
        }

        /**
         * relations
         *
         * @var Shopgate_Model_XmlResultObject  $relationsNode
         * @var Shopgate_Model_Catalog_Relation $relationItem
         */
        $relationsNode = $itemNode->addChild('relations');
        foreach ($this->getRelations() as $relationItem) {
            $relationItem->asXml($relationsNode);
        }

        /**
         * attribute / options
         *
         * @var Shopgate_Model_XmlResultObject        $attributeGroupsNode
         * @var Shopgate_Model_XmlResultObject        $attributesNode
         * @var Shopgate_Model_Catalog_Attribute      $attributeItem
         * @var Shopgate_Model_Catalog_AttributeGroup $attributeGroupItem
         */
        if ($this->getIsChild()) {
            $attributesNode = $itemNode->addChild('attributes');
            foreach ($this->getAttributes() as $attributeItem) {
                $attributeItem->asXml($attributesNode);
            }
        } else {
            $attributeGroupsNode = $itemNode->addChild('attribute_groups');
            foreach ($this->getAttributeGroups() as $attributeGroupItem) {
                $attributeGroupItem->asXml($attributeGroupsNode);
            }
        }

        /**
         * inputs
         *
         * @var Shopgate_Model_XmlResultObject $inputsNode
         * @var Shopgate_Model_Catalog_Input   $inputItem
         */
        $inputsNode = $itemNode->addChild('inputs');
        foreach ($this->getInputs() as $inputItem) {
            $inputItem->asXml($inputsNode);
        }

        $itemNode->addChild('display_type', $this->getDisplayType());

        /**
         * children
         *
         * @var Shopgate_Model_XmlResultObject $childrenNode
         * @var object                         $itemNode ->children
         * @var Shopgate_Model_Catalog_Product $child
         * @var Shopgate_Model_XmlResultObject $childXml
         */
        if (!$this->getIsChild()) {
            $childrenNode = $itemNode->addChild('children');
            foreach ($this->getChildren() as $child) {
                $child->asXml($childrenNode);
            }
            /**
             * remove empty nodes
             */
            if (self::DEFAULT_CLEAN_CHILDREN_NODES && count($this->getChildren()) > 0) {
                foreach ($itemNode->children as $childXml) {
                    $itemNode->replaceChild($this->removeEmptyNodes($childXml), $itemNode->children);
                }
            }
        }

        return $itemsNode;
    }
1016073
protected function doLoad($itemClass)
	{
		$itemMetaData = $this->newItemMetaDataInstance($itemClass);
		$entityDefinitions = $this->annotationDriver->loadEntityDefinitions($itemClass);
		$itemMetaData->mapEntities($entityDefinitions);
		$hitDefinitions = $this->annotationDriver->loadHitDefinitions($itemClass);
		$itemMetaData->mapHits($hitDefinitions);
		return $itemMetaData;
	}
643118
private function getNodeValue( $domNode )
	{
		if( !( $domNode->nodeType == 1 && $domNode->childNodes->length > 0 ) )
			return NULL;
		return $domNode->childNodes->item(0)->nodeValue;
	}
17149
function (xmlNode, nodeName) {

            var childs = xmlNode.childNodes;

            for (var i = 0; i < childs.length; ++i) {

                var item = childs.item(i);

                if (item.nodeType !== 1) {
                    continue;
                }

                if ((item.nodeName && !nodeName) || (nodeName && nodeName === item.nodeName)) {
                    return item;
                }
            }

            return null;
        }
1112432
public function getTreeItemFullPath($itemId, MapperTreeItemInterface $tree)
    {
        $path = $this->findRecursiveFullPath($itemId, $tree);

        if (0 < count($path)) {
            $path[$tree->getId()] = $tree->getTitle();
            $path = array_reverse($path, true);
        }

        return $path;
    }
15786
public static function initFromItemClass($itemClass)
	{
		$itemMetaData = new ItemMetaData();
		$itemMetaData->setItemClass($itemClass);
		$contruct = new ReflectionMethod($itemClass, '__construct');
		/* @var $param \ReflectionParameter */
		foreach($contruct->getParameters() as $key => $param)
		{
			$itemMetaData->setHitPosition($param->getName(), $key);
			if(!$param->isOptional())
			{
				$itemMetaData->addRequiredHit($param->getName());
			}
		}
		return $itemMetaData;
	}
126991
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $shippingNode
         */
        $shippingNode = $itemNode->addChild('shipping');
        $shippingNode->addChild('costs_per_order', $this->getCostsPerOrder(), null, false);
        $shippingNode->addChild('additional_costs_per_unit', $this->getAdditionalCostsPerUnit(), null, false);
        $shippingNode->addChild('is_free', (int)$this->getIsFree());

        return $itemNode;
    }
31616
public static function fromString($itemValue)
    {
        $bits = preg_split(
            '/\s*(?:;*("[^"]+");*|;*(\'[^\']+\');*|;+)\s*/',
            $itemValue,
            0,
            PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE
        );
        $value = array_shift($bits);
        $attributes = array();

        $lastNullAttribute = null;
        foreach ($bits as $bit) {
            if (($start = substr($bit, 0, 1)) === ($end = substr($bit, -1)) &&
                ('"' === $start || '\'' === $start)) {
                $attributes[$lastNullAttribute] = substr($bit, 1, -1);
            } elseif ('=' === $end) {
                $lastNullAttribute = $bit = substr($bit, 0, -1);
                $attributes[$bit] = null;
            } else {
                $parts = explode('=', $bit);
                $attributes[$parts[0]] = isset($parts[1]) && strlen($parts[1]) > 0 ? $parts[1] : '';
            }
        }

        return new self(($start = substr($value, 0, 1)) === ($end = substr($value, -1)) &&
        ('"' === $start || '\'' === $start) ? substr($value, 1, -1) : $value, $attributes);
    }
692644
protected function getBaseDocument(Item $item, array $itemRecord)
    {
        $type = $item->getType();
        $rootPageUid = $item->getRootPageUid();
        $accessRootLine = $this->getAccessRootline($item);
        return $this->documentBuilder->fromRecord($itemRecord, $type, $rootPageUid, $accessRootLine);
    }
214316
public function getItem($itemId, $data = null)
	{
		$params = $this->setUpParams('item', $itemId, $data, 'itemListData', 'itemData');
		$array  = $this->makeRequest('item', $itemId, $params);

		if ($this->appendId($itemId))
		{
			return new staticItem($array);
		}
		else
		{
			return new ItemList($array);
		}
	}
130268
public function set($sectionName, $itemName, $itemValue)
    {
        $section = $this->getSection($sectionName);
        $section->set($itemName, $itemValue);

        return $this;
    }
792704
public function getMostRevelantItemForNode($nodeId)
    {
        if (isset($this->perNode[$nodeId])) {
            return reset($this->perNode[$nodeId]);
        }
    }
892928
protected function getNodeValueAsObject($xquery, $className)
    {
      $nodeList = $this->document->getXPath()->query($xquery, $this->node);

      if($nodeList->length == 0)
        throw new Exception(__METHOD__ . '; ' . $xquery . ' node is missing');

      return new $className(utf8_decode($nodeList->item(0)->nodeValue));
    }
657180
public function xml($params, $rootNode = NULL)
    {
        $xml = new Xml($params);
        if ( $rootNode ) {
            $xml->setRootNode($rootNode);
        }

        return $xml->getContent();
    }
867214
public function addItemInstance(Nodes\NodeInterface $item, $location = null)
	{
		$location = (int) $location;

		$this->items[$location][] = $item;

		if ($id = $item->getId()) {
			$this->ids[$id] = $item;
		}

		return $item;
	}