private function getUrlAliasesForSwappedLocations(
        Language $language,
        SwappedLocationProperties $location1,
        SwappedLocationProperties $location2
    ) {
        $isMainLanguage1 = $language->id == $location1->mainLanguageId;
        $isMainLanguage2 = $language->id == $location2->mainLanguageId;
        $urlAliases = [];
        if (isset($location1->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location1->id,
                $location1->parentId,
                $location1->name,
                $isMainLanguage2 && $location1->isAlwaysAvailable,
                $isMainLanguage2,
                $location1->autogeneratedId
            );
        }

        if (isset($location2->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location2->id,
                $location2->parentId,
                $location2->name,
                $isMainLanguage1 && $location2->isAlwaysAvailable,
                $isMainLanguage1,
                $location2->autogeneratedId
            );

            if (isset($location1->name) && $this->shouldUrlAliasForSecondLocationBePublishedFirst(
                    $location1->entries,
                    $location1->parentId,
                    $location1->name,
                    $location2->entries,
                    $location2->parentId,
                    $location2->name,
                    $language->id
                )) {
                $urlAliases = array_reverse($urlAliases);
            }
        }

        return $urlAliases;
    }
private function getUrlAliasesForSwappedLocations(
        Language $language,
        SwappedLocationProperties $location1,
        SwappedLocationProperties $location2
    ) {
        $isMainLanguage1 = $language->id == $location1->mainLanguageId;
        $isMainLanguage2 = $language->id == $location2->mainLanguageId;
        $urlAliases = [];
        if (isset($location1->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location1->id,
                $location1->parentId,
                $location1->name,
                $isMainLanguage2 && $location1->isAlwaysAvailable,
                $isMainLanguage2,
                $location1->autogeneratedId
            );
        }

        if (isset($location2->name)) {
            $urlAliases[] = new UrlAliasForSwappedLocation(
                $location2->id,
                $location2->parentId,
                $location2->name,
                $isMainLanguage1 && $location2->isAlwaysAvailable,
                $isMainLanguage1,
                $location2->autogeneratedId
            );

            if (isset($location1->name) && $this->shouldUrlAliasForSecondLocationBePublishedFirst(
                    $location1->entries,
                    $location1->parentId,
                    $location1->name,
                    $location2->entries,
                    $location2->parentId,
                    $location2->name,
                    $language->id
                )) {
                $urlAliases = array_reverse($urlAliases);
            }
        }

        return $urlAliases;
    }
private function getUrlAliasesForSwappedLocations ( Language $ language , SwappedLocationProperties $ location1 , SwappedLocationProperties $ location2 ) { $ isMainLanguage1 = $ language -> id == $ location1 -> mainLanguageId ; $ isMainLanguage2 = $ language -> id == $ location2 -> mainLanguageId ; $ urlAliases = [ ] ; if ( isset ( $ location1 -> name ) ) { $ urlAliases [ ] = new UrlAliasForSwappedLocation ( $ location1 -> id , $ location1 -> parentId , $ location1 -> name , $ isMainLanguage2 && $ location1 -> isAlwaysAvailable , $ isMainLanguage2 , $ location1 -> autogeneratedId ) ; } if ( isset ( $ location2 -> name ) ) { $ urlAliases [ ] = new UrlAliasForSwappedLocation ( $ location2 -> id , $ location2 -> parentId , $ location2 -> name , $ isMainLanguage1 && $ location2 -> isAlwaysAvailable , $ isMainLanguage1 , $ location2 -> autogeneratedId ) ; if ( isset ( $ location1 -> name ) && $ this -> shouldUrlAliasForSecondLocationBePublishedFirst ( $ location1 -> entries , $ location1 -> parentId , $ location1 -> name , $ location2 -> entries , $ location2 -> parentId , $ location2 -> name , $ language -> id ) ) { $ urlAliases = array_reverse ( $ urlAliases ) ; } } return $ urlAliases ; }
Get in a proper order - to be published - a list of URL aliases for swapped Locations.

@see shouldUrlAliasForSecondLocationBePublishedFirst

@param \eZ\Publish\SPI\Persistence\Content\Language $language
@param \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\DTO\SwappedLocationProperties $location1
@param \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\DTO\SwappedLocationProperties $location2

@return \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\DTO\UrlAliasForSwappedLocation[]
Get in a proper order - to be published - a list of URL aliases for swapped Locations .