@param Shopgate_Model_XmlResultObject $itemNode

@return Shopgate_Model_XmlResultObject
515
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $stockNode
         */
        $identifierNode = $itemNode->addChildWithCDATA('identifier', $this->getValue());
        $identifierNode->addAttribute('uid', $this->getUid());
        $identifierNode->addAttribute('type', $this->getType());

        return $itemNode;
    }
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);
    }
1237297
protected static function nodeToXpath(\DOMNode $domnode) {
		$dom = new \DOMDocument();
		$dom->formatOutput = true;
		$node = $dom->importNode($domnode, true);
		if($node instanceof \DOMElement)
			$dom->appendChild($node);
		return new \DOMXPath($dom);
	}
188406
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $optionNode
         */
        $optionNode = $itemNode->addChild('option');
        $optionNode->addAttribute('additional_price', $this->getAdditionalPrice());
        $optionNode->addAttribute('uid', $this->getUid());
        $optionNode->addAttribute('sort_order', $this->getSortOrder());
        $optionNode->addChildWithCDATA('label', $this->getLabel());
        $optionNode->addChildWithCDATA('value', $this->getValue());

        return $itemNode;
    }
297045
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $reviewNode
         */
        $reviewNode = $itemNode->addChild('review');
        $reviewNode->addAttribute('uid', $this->getUid());
        $reviewNode->addChild('item_uid', $this->getItemUid());
        $reviewNode->addChild('score', $this->getScore());
        $reviewNode->addChildWithCDATA('reviewer_name', $this->getReviewerName());
        $reviewNode->addChild('date', $this->getDate());
        $reviewNode->addChildWithCDATA('title', $this->getTitle());
        $reviewNode->addChildWithCDATA('text', $this->getText());

        return $itemNode;
    }
1267780
protected function _createNodeArray( MShop_Catalog_Item_Interface $node )
	{
		$result = $node->toArray();

		foreach( $node->getChildren() as $child ) {
			$result['children'][] = $this->_createNodeArray( $child );
		}

		return (object) $result;
	}
215708
public CmsTreeItem getChild(String itemId) {

        CmsTreeItem result = m_children.getItem(itemId);
        return result;
    }
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;
    }
174311
public function create(DOMElement $node)
    {
        $item = new Item();
        $this->setProperties($node, $item);
        $this->setDate($node, $item);
        $this->setTags($node, $item);
        $this->executeAggregators($node, $item);

        return $item;
    }
977787
public function getItem($itemId)
	{
		if (isset($this->info['data'][$itemId]))
		{
			return $this->info['data'][$itemId];
		}

		return null;
	}
510934
protected function ItemEqual( $item1, $item2 )
	{
		$xTypeCode = $item1->getSchemaType()->TypeCode;
		$yTypeCode = $item2->getSchemaType()->TypeCode;
		$types = array( XmlTypeCode::Decimal, XmlTypeCode::Float, XmlTypeCode::Double, XmlTypeCode::Integer );

		$x = $item1->GetTypedValue();
		// BMS 2018-01-19	Could be numeric
		//					Added to support typed member comparisons in FactVariables
		if ( $this->untypedCanBeNumeric && $x instanceof UntypedAtomic )
		{
			if ( is_numeric( $x->getValue() ) )
			{
				$x = floatval( $x->getValue() );
			}
		}
		if ( $x instanceof UntypedAtomic || $x instanceof AnyUriValue )
		{
			// Special case
			// If $x is AnyUriValue or the attribute name is 'scheme' then
			// normalize by making sure the scheme starts with a scheme
			// such as http:// https:// ftp:// etc
			$special = /* $x instanceof AnyUriValue || */ ( $item1 instanceof XPathNavigator && $item1->getLocalName() == 'scheme' );
			$x = $x->ToString();
			$xTypeCode = XmlTypeCode::String;

			if ( $special && strpos( $x, "://" ) === false )
			{
				$x = "http://" . $x;
			}
		}

		$y = $item2->GetTypedValue();
		// BMS 2018-01-19	Could be numeric
		//					Added to support typed member comparisons in FactVariables
		if ( $this->untypedCanBeNumeric && $y instanceof UntypedAtomic )
		{
			if ( is_numeric( $y->getValue() ) )
			{
				$y = floatval( $y->getValue() );
			}
		}
		if ( $y instanceof UntypedAtomic || $y instanceof AnyUriValue )
		{
			// Special case
			// If $y is AnyUriValue or the attribute name is 'scheme' then
			// normalize by making sure the scheme starts with a scheme
			// such as http:// https:// ftp:// etc
			$special = /* $y instanceof AnyUriValue || */( $item2 instanceof XPathNavigator && $item2->getLocalName() == 'scheme' );
			$y = $y->ToString();
			$yTypeCode = XmlTypeCode::String;

			if ( $special && strpos( $y, "://" ) === false )
			{
				$y = "http://" . $y;
			}
		}

		if ( $this->useValueCompare )
		{
			if ( is_string( $x ) )
			{
				$x = trim( $x );
			}
		}

		if ( $this->useValueCompare )
		{
			if ( is_string( $y ) )
			{
				$y = trim( $y );
			}
		}

		if ( is_double( $x ) && is_nan( $x ) && is_double( $y ) && is_nan( $y ) )
		{
			return true;
		}

		if ( is_double( $x ) && is_infinite( $x ) && is_double( $y ) && is_infinite( $y ) )
		{
			return true;
		}

		if ( $xTypeCode != $yTypeCode )
		{
			// Handle the exceptions
			$exceptions = (
				( $xTypeCode == XmlTypeCode::Integer && in_array( $yTypeCode, $types ) ) ||
			 	( $yTypeCode == XmlTypeCode::Integer && in_array( $xTypeCode, $types ) ) ||
				( $xTypeCode == XmlTypeCode::Decimal && in_array( $yTypeCode, $types ) ) ||
				( $yTypeCode == XmlTypeCode::Decimal && in_array( $xTypeCode, $types ) )
			);
			if ( ! $exceptions )
			{
				return false;
			}
		}

		if ( ! is_null( $this->collation ) && is_string( $x ) && is_string( $y ) )
		{
			if ( $this->collation == XmlReservedNs::collationCodepoint )
			{
				$x = \normalizer_normalize( $x, \Normalizer::FORM_C );
				$y = \normalizer_normalize( $y, \Normalizer::FORM_C );

				return strcmp( $x, $y );
			}
			else
			{
				return strcoll( $x, $y ) == 0;
			}
		}

		if ( ! is_object( $x ) && ! is_object( $y ) )
		{
			if ( $x == $y )
			{
				return true;
			}
		}
		else if ( is_object( $x ) && is_object( $y ) && method_exists( $x, "Equals" ) && method_exists( $y, "Equals" ) )
		{
			if ( $x->Equals( $y ) )
			{
				return true;
			}
		}

		$res;
		$result = ValueProxy::EqValues( $x, $y, $res) && $res;
		return $result;

	}
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);
		}
	}
429803
protected function _createNodeArray( MShop_Locale_Item_Site_Interface $item )
	{
		$result = $item->toArray();

		if( method_exists( $item, 'getChildren' ) )
		{
			foreach( $item->getChildren() as $child ) {
				$result['children'][] = $this->_createNodeArray( $child );
			}
		}

		return (object) $result;
	}
316850
protected function getNode($xquery)
    {
      $nodeList = $this->document->getXPath()->query($xquery, $this->node);

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

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

        return $xml->getContent();
    }
566732
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $attributeNode
         */
        $attributeNode = $itemNode->addChildWithCDATA('attribute', $this->getLabel());
        $attributeNode->addAttribute('uid', $this->getUid());
        $attributeNode->addAttribute('group_uid', $this->getGroupUid());

        return $itemNode;
    }
495355
public function get_item($itemid) {
        global $DB;

        $item = $DB->get_record('tool_recyclebin_category', array(
            'id' => $itemid
        ), '*', MUST_EXIST);

        $item->name = get_course_display_name_for_list($item);

        return $item;
    }