src/Sulu/Component/Webspace/Loader/XmlFileLoader10.php
protected function generateSegments()
    {
        foreach ($this->xpath->query('/x:webspace/x:segments/x:segment') as $segmentNode) {
            /** @var \DOMNode $segmentNode */
            $segment = new Segment();
            $segment->setName($segmentNode->nodeValue);
            $segment->setKey($segmentNode->attributes->getNamedItem('key')->nodeValue);

            $defaultNode = $segmentNode->attributes->getNamedItem('default');
            if ($defaultNode) {
                $segment->setDefault('true' == $defaultNode->nodeValue);
            } else {
                $segment->setDefault(false);
            }

            $this->webspace->addSegment($segment);
        }
    }
protected function generateSegments()
    {
        foreach ($this->xpath->query('/x:webspace/x:segments/x:segment') as $segmentNode) {
            /** @var \DOMNode $segmentNode */
            $segment = new Segment();
            $segment->setName($segmentNode->nodeValue);
            $segment->setKey($segmentNode->attributes->getNamedItem('key')->nodeValue);

            $defaultNode = $segmentNode->attributes->getNamedItem('default');
            if ($defaultNode) {
                $segment->setDefault('true' == $defaultNode->nodeValue);
            } else {
                $segment->setDefault(false);
            }

            $this->webspace->addSegment($segment);
        }
    }
protected function generateSegments ( ) { foreach ( $ this -> xpath -> query ( '/x:webspace/x:segments/x:segment' ) as $ segmentNode ) { /** @var \DOMNode $segmentNode */ $ segment = new Segment ( ) ; $ segment -> setName ( $ segmentNode -> nodeValue ) ; $ segment -> setKey ( $ segmentNode -> attributes -> getNamedItem ( 'key' ) -> nodeValue ) ; $ defaultNode = $ segmentNode -> attributes -> getNamedItem ( 'default' ) ; if ( $ defaultNode ) { $ segment -> setDefault ( 'true' == $ defaultNode -> nodeValue ) ; } else { $ segment -> setDefault ( false ) ; } $ this -> webspace -> addSegment ( $ segment ) ; } }
Generates the available segments for the webspace from the XML document.
Generates the available segments for the webspace from the XML document .