src/Sulu/Component/Webspace/Loader/XmlFileLoader10.php
protected function generateUrls(\DOMNode $environmentNode, Environment $environment)
    {
        foreach ($this->xpath->query('x:urls/x:url', $environmentNode) as $urlNode) {
            // check if the url is valid, and throw an exception otherwise
            if (!$this->checkUrlNode($urlNode)) {
                throw new InvalidUrlDefinitionException($this->webspace, $urlNode->nodeValue);
            }

            /** @var \DOMNode $urlNode */
            $url = new Url();

            $url->setUrl(rtrim($urlNode->nodeValue, '/'));

            // set optional nodes
            $url->setLanguage($this->getOptionalNodeAttribute($urlNode, 'language'));
            $url->setCountry($this->getOptionalNodeAttribute($urlNode, 'country'));
            $url->setSegment($this->getOptionalNodeAttribute($urlNode, 'segment'));
            $url->setRedirect($this->getOptionalNodeAttribute($urlNode, 'redirect'));
            $url->setMain($this->getOptionalNodeAttribute($urlNode, 'main', false));

            $environment->addUrl($url);
        }
    }
protected function generateUrls(\DOMNode $environmentNode, Environment $environment)
    {
        foreach ($this->xpath->query('x:urls/x:url', $environmentNode) as $urlNode) {
            // check if the url is valid, and throw an exception otherwise
            if (!$this->checkUrlNode($urlNode)) {
                throw new InvalidUrlDefinitionException($this->webspace, $urlNode->nodeValue);
            }

            /** @var \DOMNode $urlNode */
            $url = new Url();

            $url->setUrl(rtrim($urlNode->nodeValue, '/'));

            // set optional nodes
            $url->setLanguage($this->getOptionalNodeAttribute($urlNode, 'language'));
            $url->setCountry($this->getOptionalNodeAttribute($urlNode, 'country'));
            $url->setSegment($this->getOptionalNodeAttribute($urlNode, 'segment'));
            $url->setRedirect($this->getOptionalNodeAttribute($urlNode, 'redirect'));
            $url->setMain($this->getOptionalNodeAttribute($urlNode, 'main', false));

            $environment->addUrl($url);
        }
    }
protected function generateUrls ( \ DOMNode $ environmentNode , Environment $ environment ) { foreach ( $ this -> xpath -> query ( 'x:urls/x:url' , $ environmentNode ) as $ urlNode ) { // check if the url is valid, and throw an exception otherwise if ( ! $ this -> checkUrlNode ( $ urlNode ) ) { throw new InvalidUrlDefinitionException ( $ this -> webspace , $ urlNode -> nodeValue ) ; } /** @var \DOMNode $urlNode */ $ url = new Url ( ) ; $ url -> setUrl ( rtrim ( $ urlNode -> nodeValue , '/' ) ) ; // set optional nodes $ url -> setLanguage ( $ this -> getOptionalNodeAttribute ( $ urlNode , 'language' ) ) ; $ url -> setCountry ( $ this -> getOptionalNodeAttribute ( $ urlNode , 'country' ) ) ; $ url -> setSegment ( $ this -> getOptionalNodeAttribute ( $ urlNode , 'segment' ) ) ; $ url -> setRedirect ( $ this -> getOptionalNodeAttribute ( $ urlNode , 'redirect' ) ) ; $ url -> setMain ( $ this -> getOptionalNodeAttribute ( $ urlNode , 'main' , false ) ) ; $ environment -> addUrl ( $ url ) ; } }
Generates the URLs for the given environment.

@param \DOMNode $environmentNode
@param Environment $environment

@throws Exception\InvalidUrlDefinitionException
Generates the URLs for the given environment .