PHP Класс eZ\Publish\Core\Repository\URLAliasService

Наследование: implements eZ\Publish\API\Repository\URLAliasService
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$repository eZ\Publish\API\Repository\Repository
$settings array
$urlAliasHandler eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler

Открытые методы

Метод Описание
__construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler $urlAliasHandler, array $settings = [] ) Setups service with reference to repository object that created it & corresponding handler.
createGlobalUrlAlias ( string $resource, string $path, string $languageCode, boolean $forwarding = false, boolean $alwaysAvailable = false ) : eZ\Publish\API\Repository\Values\Content\URLAlias Create a user chosen $alias pointing to a resource in $languageCode.
createUrlAlias ( eZ\Publish\API\Repository\Values\Content\Location $location, string $path, string $languageCode, boolean $forwarding = false, boolean $alwaysAvailable = false ) : eZ\Publish\API\Repository\Values\Content\URLAlias Create a user chosen $alias pointing to $location in $languageCode.
listGlobalAliases ( string $languageCode = null, integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\Content\URLAlias[] List global aliases.
listLocationAliases ( eZ\Publish\API\Repository\Values\Content\Location $location, boolean $custom = true, string $languageCode = null, null | boolean $showAllTranslations = null, array $prioritizedLanguageList = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias[] List of url aliases pointing to $location, sorted by language priority.
load ( string $id ) : eZ\Publish\API\Repository\Values\Content\URLAlias Loads URL alias by given $id.
lookup ( string $url, string $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias looks up the URLAlias for the given url.
removeAliases ( array $aliasList ) Removes urls aliases.
reverseLookup ( eZ\Publish\API\Repository\Values\Content\Location $location, string $languageCode = null, null | boolean $showAllTranslations = null, array $prioritizedLanguageList = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias Returns the URL alias for the given location in the given language.

Защищенные методы

Метод Описание
buildSPIUrlAlias ( eZ\Publish\API\Repository\Values\Content\URLAlias $urlAlias ) : eZ\Publish\SPI\Persistence\Content\URLAlias Builds persistence domain object.
buildUrlAliasDomainObject ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $path ) : eZ\Publish\API\Repository\Values\Content\URLAlias Builds API UrlAlias object from given SPI UrlAlias object.
choosePrioritizedLanguageCode ( array $entries, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean Returns language code with highest priority.
cleanUrl ( string $url ) : string
extractPath ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string $languageCode, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean Returns path extracted from normalized path data returned from persistence, using language settings.
isPathLoadable ( array $pathData, array $languageCodes ) : boolean Returns true or false depending if URL alias is loadable or not for language settings in place.
isUrlAliasLoadable ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $languageCode, $showAllTranslations, $prioritizedLanguageList ) : boolean Returns true or false depending if URL alias is loadable or not for language settings in place.
matchLanguageCode ( array $pathElementData, string $pathElement ) : string | boolean
matchPath ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string $path, string $languageCode ) : array Matches path string with normalized path data returned from persistence.
selectAliasLanguageCode ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $languageCode, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean Determines alias language code.

Приватные методы

Метод Описание
sortTranslationsByPrioritizedLanguages ( array $translations ) : array Needed when translations for the part of the alias are the same for multiple languages.

Описание методов

__construct() публичный Метод

Setups service with reference to repository object that created it & corresponding handler.
public __construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler $urlAliasHandler, array $settings = [] )
$repository eZ\Publish\API\Repository\Repository
$urlAliasHandler eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler
$settings array

buildSPIUrlAlias() защищенный Метод

Builds persistence domain object.
protected buildSPIUrlAlias ( eZ\Publish\API\Repository\Values\Content\URLAlias $urlAlias ) : eZ\Publish\SPI\Persistence\Content\URLAlias
$urlAlias eZ\Publish\API\Repository\Values\Content\URLAlias
Результат eZ\Publish\SPI\Persistence\Content\URLAlias

buildUrlAliasDomainObject() защищенный Метод

Builds API UrlAlias object from given SPI UrlAlias object.
protected buildUrlAliasDomainObject ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $path ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$spiUrlAlias eZ\Publish\SPI\Persistence\Content\URLAlias
$path string | null
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

choosePrioritizedLanguageCode() защищенный Метод

Will return false if language code could nto be matched with language settings in place.
protected choosePrioritizedLanguageCode ( array $entries, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean
$entries array
$showAllTranslations boolean
$prioritizedLanguageList string[]
Результат string | boolean

cleanUrl() защищенный Метод

protected cleanUrl ( string $url ) : string
$url string
Результат string

createGlobalUrlAlias() публичный Метод

This method does not handle location resources - if a user enters a location target the createCustomUrlAlias method has to be used. This method runs URL filters and and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given. $alwaysAvailable makes the alias available in all languages.
public createGlobalUrlAlias ( string $resource, string $path, string $languageCode, boolean $forwarding = false, boolean $alwaysAvailable = false ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$resource string
$path string
$languageCode string
$forwarding boolean
$alwaysAvailable boolean
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

createUrlAlias() публичный Метод

This method runs URL filters and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given. $alwaysAvailable makes the alias available in all languages.
public createUrlAlias ( eZ\Publish\API\Repository\Values\Content\Location $location, string $path, string $languageCode, boolean $forwarding = false, boolean $alwaysAvailable = false ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$location eZ\Publish\API\Repository\Values\Content\Location
$path string
$languageCode string the languageCode for which this alias is valid
$forwarding boolean if true a redirect is performed
$alwaysAvailable boolean
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

extractPath() защищенный Метод

Will return false if path could not be determined.
protected extractPath ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string $languageCode, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean
$spiUrlAlias eZ\Publish\SPI\Persistence\Content\URLAlias
$languageCode string
$showAllTranslations boolean
$prioritizedLanguageList string[]
Результат string | boolean

isPathLoadable() защищенный Метод

Returns true or false depending if URL alias is loadable or not for language settings in place.
protected isPathLoadable ( array $pathData, array $languageCodes ) : boolean
$pathData array
$languageCodes array
Результат boolean

isUrlAliasLoadable() защищенный Метод

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
Результат boolean

listGlobalAliases() публичный Метод

List global aliases.
public listGlobalAliases ( string $languageCode = null, integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\Content\URLAlias[]
$languageCode string filters those which are valid for the given language
$offset integer
$limit integer
Результат eZ\Publish\API\Repository\Values\Content\URLAlias[]

listLocationAliases() публичный Метод

List of url aliases pointing to $location, sorted by language priority.
public listLocationAliases ( eZ\Publish\API\Repository\Values\Content\Location $location, boolean $custom = true, string $languageCode = null, null | boolean $showAllTranslations = null, array $prioritizedLanguageList = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias[]
$location eZ\Publish\API\Repository\Values\Content\Location
$custom boolean if true the user generated aliases are listed otherwise the autogenerated
$languageCode string filters those which are valid for the given language
$showAllTranslations null | boolean
$prioritizedLanguageList array
Результат eZ\Publish\API\Repository\Values\Content\URLAlias[]

load() публичный Метод

Loads URL alias by given $id.
public load ( string $id ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$id string
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

lookup() публичный Метод

looks up the URLAlias for the given url.
public lookup ( string $url, string $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$url string
$languageCode string
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

matchLanguageCode() защищенный Метод

protected matchLanguageCode ( array $pathElementData, string $pathElement ) : string | boolean
$pathElementData array
$pathElement string
Результат string | boolean

matchPath() защищенный Метод

Returns matched path string (possibly case corrected) and array of corresponding language codes or false if path could not be matched.
protected matchPath ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string $path, string $languageCode ) : array
$spiUrlAlias eZ\Publish\SPI\Persistence\Content\URLAlias
$path string
$languageCode string
Результат array

removeAliases() публичный Метод

This method does not remove autogenerated aliases for locations.
public removeAliases ( array $aliasList )
$aliasList array

reverseLookup() публичный Метод

If $languageCode is null the method returns the url alias in the most prioritized language.
public reverseLookup ( eZ\Publish\API\Repository\Values\Content\Location $location, string $languageCode = null, null | boolean $showAllTranslations = null, array $prioritizedLanguageList = null ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$location eZ\Publish\API\Repository\Values\Content\Location
$languageCode string
$showAllTranslations null | boolean
$prioritizedLanguageList array
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

selectAliasLanguageCode() защищенный Метод

Method will return false if language code can't be matched against alias language codes or language settings.
protected selectAliasLanguageCode ( eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias, string | null $languageCode, boolean $showAllTranslations, string[] $prioritizedLanguageList ) : string | boolean
$spiUrlAlias eZ\Publish\SPI\Persistence\Content\URLAlias
$languageCode string | null
$showAllTranslations boolean
$prioritizedLanguageList string[]
Результат string | boolean

Описание свойств

$repository защищенное свойство

protected Repository,eZ\Publish\API\Repository $repository
Результат eZ\Publish\API\Repository\Repository

$settings защищенное свойство

protected array $settings
Результат array

$urlAliasHandler защищенное свойство

protected Handler,eZ\Publish\SPI\Persistence\Content\UrlAlias $urlAliasHandler
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler