eZ\Publish\Core\Repository\URLAliasService::isUrlAliasLoadable PHP Method

isUrlAliasLoadable() protected method

Returns true or false depending if URL alias is loadable or not for language settings in place.
protected isUrlAliasLoadable ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $languageCode, $showAllTranslations, $prioritizedLanguageList ) : boolean
$spiUrlAlias eZ\Publish\SPI\Persistence\Content\URLAlias
$languageCode string | null
return boolean
    protected function isUrlAliasLoadable(SPIURLAlias $spiUrlAlias, $languageCode, $showAllTranslations, $prioritizedLanguageList)
    {
        if (isset($languageCode) && !in_array($languageCode, $spiUrlAlias->languageCodes)) {
            return false;
        }
        if ($showAllTranslations) {
            return true;
        }
        foreach ($spiUrlAlias->pathData as $levelPathData) {
            if ($levelPathData['always-available']) {
                continue;
            }
            foreach ($levelPathData['translations'] as $translationLanguageCode => $translation) {
                if (in_array($translationLanguageCode, $prioritizedLanguageList)) {
                    continue 2;
                }
            }
            return false;
        }
        return true;
    }