src/Sulu/Component/Webspace/Manager/WebspaceCollectionBuilder.php
private function buildUrls(
        Portal $portal,
        Environment $environment,
        Url $url,
        $segments,
        $urlAddress
    ) {
        if ($url->getLanguage()) {
            $language = $url->getLanguage();
            $country = $url->getCountry();
            $locale = $language . ($country ? '_' . $country : '');

            $this->buildUrlFullMatch(
                $portal,
                $environment,
                $segments,
                [],
                $urlAddress,
                $portal->getLocalization($locale),
                $url
            );
        } else {
            // create all the urls for every localization/segment combination
            foreach ($portal->getLocalizations() as $localization) {
                $language = $url->getLanguage() ? $url->getLanguage() : $localization->getLanguage();
                $country = $url->getCountry() ? $url->getCountry() : $localization->getCountry();

                $replacers = [
                    ReplacerInterface::REPLACER_LANGUAGE => $language,
                    ReplacerInterface::REPLACER_COUNTRY => $country,
                    ReplacerInterface::REPLACER_LOCALIZATION => $localization->getLocale(Localization::DASH),
                ];

                $this->buildUrlFullMatch(
                    $portal,
                    $environment,
                    $segments,
                    $replacers,
                    $urlAddress,
                    $localization,
                    $url
                );
            }
            $this->buildUrlPartialMatch(
                $portal,
                $environment,
                $urlAddress,
                $url
            );
        }
    }
private function buildUrls(
        Portal $portal,
        Environment $environment,
        Url $url,
        $segments,
        $urlAddress
    ) {
        if ($url->getLanguage()) {
            $language = $url->getLanguage();
            $country = $url->getCountry();
            $locale = $language . ($country ? '_' . $country : '');

            $this->buildUrlFullMatch(
                $portal,
                $environment,
                $segments,
                [],
                $urlAddress,
                $portal->getLocalization($locale),
                $url
            );
        } else {
            // create all the urls for every localization/segment combination
            foreach ($portal->getLocalizations() as $localization) {
                $language = $url->getLanguage() ? $url->getLanguage() : $localization->getLanguage();
                $country = $url->getCountry() ? $url->getCountry() : $localization->getCountry();

                $replacers = [
                    ReplacerInterface::REPLACER_LANGUAGE => $language,
                    ReplacerInterface::REPLACER_COUNTRY => $country,
                    ReplacerInterface::REPLACER_LOCALIZATION => $localization->getLocale(Localization::DASH),
                ];

                $this->buildUrlFullMatch(
                    $portal,
                    $environment,
                    $segments,
                    $replacers,
                    $urlAddress,
                    $localization,
                    $url
                );
            }
            $this->buildUrlPartialMatch(
                $portal,
                $environment,
                $urlAddress,
                $url
            );
        }
    }
private function buildUrls ( Portal $ portal , Environment $ environment , Url $ url , $ segments , $ urlAddress ) { if ( $ url -> getLanguage ( ) ) { $ language = $ url -> getLanguage ( ) ; $ country = $ url -> getCountry ( ) ; $ locale = $ language . ( $ country ? '_' . $ country : '' ) ; $ this -> buildUrlFullMatch ( $ portal , $ environment , $ segments , [ ] , $ urlAddress , $ portal -> getLocalization ( $ locale ) , $ url ) ; } else { // create all the urls for every localization/segment combination foreach ( $ portal -> getLocalizations ( ) as $ localization ) { $ language = $ url -> getLanguage ( ) ? $ url -> getLanguage ( ) : $ localization -> getLanguage ( ) ; $ country = $ url -> getCountry ( ) ? $ url -> getCountry ( ) : $ localization -> getCountry ( ) ; $ replacers = [ ReplacerInterface :: REPLACER_LANGUAGE => $ language , ReplacerInterface :: REPLACER_COUNTRY => $ country , ReplacerInterface :: REPLACER_LOCALIZATION => $ localization -> getLocale ( Localization :: DASH ) , ] ; $ this -> buildUrlFullMatch ( $ portal , $ environment , $ segments , $ replacers , $ urlAddress , $ localization , $ url ) ; } $ this -> buildUrlPartialMatch ( $ portal , $ environment , $ urlAddress , $ url ) ; } }
Builds the URLs for the portal, which are not a redirect.

@param Portal $portal
@param Environment $environment
@param $url
@param $segments
@param $urlAddress
Builds the URLs for the portal which are not a redirect .