PHP Класс eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler

Its methods operate on a representation of the url alias data structure held inside a storage engine.
Наследование: implements eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$gateway Gateway UrlAlias Gateway.
$languageHandler eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler Caching language handler.
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway Gateway for handling location data.
$mapper Mapper UrlAlias Mapper.
$slugConverter SlugConverter URL slug converter.

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

Метод Описание
__construct ( Gateway $gateway, Mapper $mapper, Gateway $locationGateway, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, SlugConverter $slugConverter ) Creates a new UrlAlias Handler.
createCustomUrlAlias ( mixed $locationId, string $path, boolean $forwarding = false, string $languageCode = null, boolean $alwaysAvailable = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias Create a user chosen $alias pointing to $locationId in $languageCode.
createGlobalUrlAlias ( string $resource, string $path, boolean $forwarding = false, string $languageCode = null, boolean $alwaysAvailable = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias Create a user chosen $alias pointing to a resource in $languageCode.
listGlobalURLAliases ( string | null $languageCode = null, integer $offset, integer $limit ) : eZ\Publish\SPI\Persistence\Content\UrlAlias[] List global aliases.
listURLAliasesForLocation ( mixed $locationId, boolean $custom = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias[] List of user generated or autogenerated url entries, pointing to $locationId.
loadUrlAlias ( string $id ) : eZ\Publish\SPI\Persistence\Content\UrlAlias Loads URL alias by given $id.
locationCopied ( mixed $locationId, mixed $newLocationId, mixed $newParentId ) Notifies the underlying engine that a location was copied.
locationDeleted ( mixed $locationId ) Notifies the underlying engine that a location was deleted or moved to trash.
locationMoved ( mixed $locationId, mixed $oldParentId, mixed $newParentId ) Notifies the underlying engine that a location has moved.
locationSwapped ( $location1Id, $location1ParentId, $location2Id, $location2ParentId )
lookup ( string $url ) : eZ\Publish\SPI\Persistence\Content\UrlAlias Looks up a url alias for the given url.
publishUrlAliasForLocation ( $locationId, $parentLocationId, $name, $languageCode, $alwaysAvailable = false, $updatePathIdentificationString = false )
removeURLAliases ( array $urlAliases ) : boolean Removes url aliases.

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

Метод Описание
copySubtree ( array $actionMap, mixed $oldParentAliasId, mixed $newParentAliasId ) Recursively copies aliases from old parent under new parent.
createUrlAlias ( string $action, string $path, boolean $forward, string | null $languageCode, boolean $alwaysAvailable ) : eZ\Publish\SPI\Persistence\Content\UrlAlias Internal method for creating global or custom URL alias (these are handled in the same way).
getCopiedLocationsMap ( mixed $oldParentId, mixed $newParentId ) : array
getHash ( string $text ) : string
getRealAliasId ( mixed $locationId ) : mixed Returns possibly corrected alias id for given $locationId !! For use as parent id in logic.
insertNopEntry ( mixed $parentId, string $text, string $textMD5 ) : mixed Convenience method for inserting nop type row.
removeSubtree ( mixed $id, string $action, mixed $original ) Recursively removes aliases by given $id and $action.

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

Метод Описание
extractLanguageIdsFromMask ( integer $languageMask ) : int[] Extracts every language Ids contained in $languageMask.
historizeBeforeSwap ( array $location1Entries, array $location2Entries ) Historizes given existing active entries for two swapped Locations.
internalPublishUrlAliasForLocation ( integer $locationId, integer $parentLocationId, string $name, integer $languageId, boolean $alwaysAvailable = false, boolean $updatePathIdentificationString = false, integer $newId = null ) Internal publish method, accepting language ID instead of language code and optionally new alias ID (used when swapping Locations).

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

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

Creates a new UrlAlias Handler.
public __construct ( Gateway $gateway, Mapper $mapper, Gateway $locationGateway, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, SlugConverter $slugConverter )
$gateway Gateway
$mapper Mapper
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$slugConverter SlugConverter

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

Recursively copies aliases from old parent under new parent.
protected copySubtree ( array $actionMap, mixed $oldParentAliasId, mixed $newParentAliasId )
$actionMap array
$oldParentAliasId mixed
$newParentAliasId mixed

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

If $languageCode is null the $alias is created in the system's default language. $alwaysAvailable makes the alias available in all languages.
public createCustomUrlAlias ( mixed $locationId, string $path, boolean $forwarding = false, string $languageCode = null, boolean $alwaysAvailable = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias
$locationId mixed
$path string
$forwarding boolean
$languageCode string
$alwaysAvailable boolean
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias

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

This method does not handle location resources - if a user enters a location target the createCustomUrlAlias method has to be used. If $languageCode is null the $alias is created in the system's default language. $alwaysAvailable makes the alias available in all languages.
public createGlobalUrlAlias ( string $resource, string $path, boolean $forwarding = false, string $languageCode = null, boolean $alwaysAvailable = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias
$resource string
$path string
$forwarding boolean
$languageCode string
$alwaysAvailable boolean
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias

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

Internal method for creating global or custom URL alias (these are handled in the same way).
protected createUrlAlias ( string $action, string $path, boolean $forward, string | null $languageCode, boolean $alwaysAvailable ) : eZ\Publish\SPI\Persistence\Content\UrlAlias
$action string
$path string
$forward boolean
$languageCode string | null
$alwaysAvailable boolean
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias

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

protected getCopiedLocationsMap ( mixed $oldParentId, mixed $newParentId ) : array
$oldParentId mixed
$newParentId mixed
Результат array

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

protected getHash ( string $text ) : string
$text string
Результат string

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

First level entries must have parent id set to 0 instead of their parent location alias id. There are two cases when alias id needs to be corrected: 1) location is special location without URL alias (location with id=1 in standard installation) 2) location is site root location, having special root entry in the ezurlalias_ml table (location with id=2 in standard installation)
protected getRealAliasId ( mixed $locationId ) : mixed
$locationId mixed
Результат mixed

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

Convenience method for inserting nop type row.
protected insertNopEntry ( mixed $parentId, string $text, string $textMD5 ) : mixed
$parentId mixed
$text string
$textMD5 string
Результат mixed

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

List global aliases.
public listGlobalURLAliases ( string | null $languageCode = null, integer $offset, integer $limit ) : eZ\Publish\SPI\Persistence\Content\UrlAlias[]
$languageCode string | null
$offset integer
$limit integer
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias[]

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

List of user generated or autogenerated url entries, pointing to $locationId.
public listURLAliasesForLocation ( mixed $locationId, boolean $custom = false ) : eZ\Publish\SPI\Persistence\Content\UrlAlias[]
$locationId mixed
$custom boolean if true the user generated aliases are listed otherwise the autogenerated
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias[]

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

Loads URL alias by given $id.
public loadUrlAlias ( string $id ) : eZ\Publish\SPI\Persistence\Content\UrlAlias
$id string
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias

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

This method triggers the creation of the autogenerated aliases for the copied locations
public locationCopied ( mixed $locationId, mixed $newLocationId, mixed $newParentId )
$locationId mixed
$newLocationId mixed
$newParentId mixed

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

Notifies the underlying engine that a location was deleted or moved to trash.
public locationDeleted ( mixed $locationId )
$locationId mixed

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

This method triggers the change of the autogenerated aliases.
public locationMoved ( mixed $locationId, mixed $oldParentId, mixed $newParentId )
$locationId mixed
$oldParentId mixed
$newParentId mixed

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

public locationSwapped ( $location1Id, $location1ParentId, $location2Id, $location2ParentId )

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

Looks up a url alias for the given url.
public lookup ( string $url ) : eZ\Publish\SPI\Persistence\Content\UrlAlias
$url string
Результат eZ\Publish\SPI\Persistence\Content\UrlAlias

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

public publishUrlAliasForLocation ( $locationId, $parentLocationId, $name, $languageCode, $alwaysAvailable = false, $updatePathIdentificationString = false )

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

$original parameter is used to limit removal of moved Location aliases to history entries only.
protected removeSubtree ( mixed $id, string $action, mixed $original )
$id mixed
$action string
$original mixed

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

Autogenerated aliases are not removed by this method.
public removeURLAliases ( array $urlAliases ) : boolean
$urlAliases array
Результат boolean

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

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

UrlAlias Gateway.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias $gateway
Результат Gateway

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

Caching language handler.
protected CachingHandler,eZ\Publish\Core\Persistence\Legacy\Content\Language $languageHandler
Результат eZ\Publish\Core\Persistence\Legacy\Content\Language\CachingHandler

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

Gateway for handling location data.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationGateway
Результат eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway

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

UrlAlias Mapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias $mapper
Результат Mapper

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

URL slug converter.
protected SlugConverter,eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias $slugConverter
Результат SlugConverter