@param Shopgate_Model_XmlResultObject $itemNode

@return Shopgate_Model_XmlResultObject
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;
    }
1301310
protected function generateItemXmlString(Parts\Item $item, DOMDocument $dom)
    {
        $itemNode = $dom->createElement('item');

        foreach ($item->getState() as $attrName => $attrValue) {
            switch ($attrName) {
                case 'action':
                    if ($attrValue !== null) {
                        $itemNode->setAttribute('action', $attrValue);
                    }
                    break;
                case 'contentId':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'object_id', $attrValue);
                    break;
                case 'locationId':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'node_id', $attrValue);
                    break;
                case 'priority':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'priority', $attrValue);
                    break;
                case 'publicationDate':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'ts_publication', $attrValue);
                    break;
                case 'visibilityDate':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'ts_visible', $attrValue);
                    break;
                case 'hiddenDate':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'ts_hidden', $attrValue);
                    break;
                case 'rotationUntilDate':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'rotation_until', $attrValue);
                    break;
                case 'movedTo':
                    $this->addNewNotEmptyXmlElement($dom, $itemNode, 'moved_to', $attrValue);
                    break;
                case 'attributes':
                    foreach ($attrValue as $arrayItemKey => $arrayItemValue) {
                        $this->addNewNotEmptyXmlElement($dom, $itemNode, $arrayItemKey, $arrayItemValue);
                    }
                    break;
            }
        }

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

        foreach ($bits as $bit) {
            list($bitName, $bitValue) = explode('=', trim($bit));

            $bitValue = self::trimEdge($bitValue, '"');
            $bitValue = self::trimEdge($bitValue, '\'');

            $attributes[$bitName] = $bitValue;
        }

        $url = self::trimEdge($value, '<');

        return new self($url, $attributes);
    }
130268
public function set($sectionName, $itemName, $itemValue)
    {
        $section = $this->getSection($sectionName);
        $section->set($itemName, $itemValue);

        return $this;
    }
869149
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $relationNode
         */
        $relationNode = $itemNode->addChild('relation');
        $relationNode->addAttribute('type', $this->getType());
        if ($this->getType() == self::DEFAULT_RELATION_TYPE_CUSTOM) {
            $relationNode->addChildWithCDATA('label', $this->getLabel());
        }
        foreach ($this->getValues() as $value) {
            $relationNode->addChild('uid', $value);
        }

        return $itemNode;
    }
321064
protected function restoreItemFromXml(DOMElement $node)
    {
        $item = array('attributes' => array());

        if ($node->hasAttributes()) {
            foreach ($node->attributes as $attr) {
                switch ($attr->name) {
                    case 'action':
                        $item['action'] = $attr->value;
                        break;
                    default:
                        $item['attributes'][$attr->name] = $attr->value;
                }
            }
        }

        foreach ($node->childNodes as $node) {
            if ($node->nodeType !== XML_ELEMENT_NODE) {
                continue;
            }

            switch ($node->nodeName) {
                case 'object_id':
                    $item['contentId'] = $node->nodeValue;
                    break;
                case 'node_id':
                    $item['locationId'] = $node->nodeValue;
                    break;
                case 'priority':
                    $item[$node->nodeName] = $node->nodeValue;
                    break;
                case 'ts_publication':
                    $item['publicationDate'] = $node->nodeValue;
                    break;
                case 'ts_visible':
                    $item['visibilityDate'] = $node->nodeValue;
                    break;
                case 'ts_hidden':
                    $item['hiddenDate'] = $node->nodeValue;
                    break;
                case 'rotation_until':
                    $item['rotationUntilDate'] = $node->nodeValue;
                    break;
                case 'moved_to':
                    $item['movedTo'] = $node->nodeValue;
                    break;
            }
        }

        return new Parts\Item($item);
    }
74391
public function asXml(Shopgate_Model_XmlResultObject $itemNode)
    {
        /**
         * @var Shopgate_Model_XmlResultObject $attachmentNode
         */
        $attachmentNode = $itemNode->addChild('attachment');
        $attachmentNode->addAttribute('number', $this->getNumber());
        $attachmentNode->addChildWithCDATA('url', $this->getUrl());
        $attachmentNode->addChild('mime_type', $this->getMimeType());
        $attachmentNode->addChild('file_name', $this->getFileName());
        $attachmentNode->addChildWithCDATA('title', $this->getTitle());
        $attachmentNode->addChildWithCDATA('description', $this->getDescription());

        return $itemNode;
    }
691953
protected function getListTextArray($listNode)
    {
        $output = array();
        foreach ($listNode->children() as $listItem) {
            $output[] = $this->getRelevantNodeText($listItem);
        }

        return $output;
    }
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;

	}
1253468
public function getNode($forceRootNode = false)
    {
        if ($forceRootNode) {
            $this->parent = null;
        }

        if (null !== $this->normalization) {
            $this->normalization->before = ExprBuilder::buildExpressions($this->normalization->before);
        }

        if (null !== $this->validation) {
            $this->validation->rules = ExprBuilder::buildExpressions($this->validation->rules);
        }

        $node = $this->createNode();
        $node->setAttributes($this->attributes);

        return $node;
    }
1326439
public static function createFromXML( DOMElement $node )
    {
        $newObj = new eZPageBlockItem();

        if ( $node->hasAttributes() )
        {
            foreach ( $node->attributes as $attr )
            {
                $newObj->setAttribute( $attr->name, $attr->value );
            }
        }

        foreach ( $node->childNodes as $node )
        {
            if ( $node->nodeType == XML_ELEMENT_NODE )
                $newObj->setAttribute( $node->nodeName, $node->nodeValue );
        }

        return $newObj;
    }
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;
    }
1298344
public function deserializeQuestion(array $itemData, AbstractItem $item = null, array $options = [])
    {
        return $this->getItemSerializer()->deserialize($itemData, $item, $options);
    }
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);
    }
184979
public function writeItem(array $item)
    {
        $newNode = $this->xml->createElement($this->rowNodeName);

        //attributes
        if (isset($item['@attributes']) && is_array($item['@attributes'])) {
            foreach ($item['@attributes'] as $key => $value) {
                $attr = $this->xml->createAttribute($key);
                $attr->value = $value;
                $newNode->appendChild($attr);
            }
            unset($item['@attributes']);
        }

        //values
        foreach ($item as $key => $value) {
            $node = $this->xml->createElement($key);
            $node->nodeValue = $value;
            $newNode->appendChild($node);
        }

        $this->rootNode->appendChild($newNode);

        return $this;
    }
858931
public function get($sectionName, $itemName, $defaultValue = null)
    {
        $section = $this->getSection($sectionName);

        return $section->get($itemName, $defaultValue);
    }
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;
	}