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

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$configuration
$transformationProcessor eZ\Publish\Core\Persistence\TransformationProcessor Transformation processor to normalize URL strings.

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

Метод Описание
__construct ( TransformationProcessor $transformationProcessor, array $configuration = [] ) Creates a new URL slug converter.
convert ( string $text, string $defaultText = '_1', string | null $transformation = null ) : string Converts given $text into a URL slug consisting of URL valid characters.
getUniqueCounterValue ( string $text, boolean $isRootLevel = true ) : integer Returns unique counter number that is appended to the path element in order to make it unique against system reserved names and other entries on the same level.

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

Метод Описание
cleanupText ( string $text, string $method ) : string Cleans up $text using given $method.
getWordSeparator ( ) : string Returns word separator value.

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

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

Creates a new URL slug converter.
public __construct ( TransformationProcessor $transformationProcessor, array $configuration = [] )
$transformationProcessor eZ\Publish\Core\Persistence\TransformationProcessor
$configuration array

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

Cleans up $text using given $method.
protected cleanupText ( string $text, string $method ) : string
$text string
$method string
Результат string

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

For non-Unicode setups this means character in the range a-z, numbers and _, for Unicode setups it means all characters except space, &, ;, /, :, =, ?, [, ], (, ), -. Invalid characters are converted to -. Example with a non-Unicode setup 'My car' => 'My-car' 'What is this?' => 'What-is-this' 'This & that' => 'This-that' 'myfile.tpl' => 'Myfile-tpl', 'øæå' => 'oeaeaa'
public convert ( string $text, string $defaultText = '_1', string | null $transformation = null ) : string
$text string
$defaultText string
$transformation string | null
Результат string

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

Comparison is done only if given $isRootLevel equals to true (it does by default), meaning that entry is at first level of URL. In a case when reserved name is matched method will return 2. When given $isRootLevel equals to false or when there is no match with reserved names this will return 1, which is default value not appended to name. Note: this is used only when publishing URL aliases, when creating global and custom aliases user is allowed to create first level entries that collide with reserved names. Also, in actual creation of the alias name will be further checked against existing elements under the same parent, using unique counter value determined here as starting unique counter value.
public getUniqueCounterValue ( string $text, boolean $isRootLevel = true ) : integer
$text string
$isRootLevel boolean
Результат integer

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

Returns word separator value.
protected getWordSeparator ( ) : string
Результат string

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

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

protected $configuration

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

Transformation processor to normalize URL strings.
protected TransformationProcessor,eZ\Publish\Core\Persistence $transformationProcessor
Результат eZ\Publish\Core\Persistence\TransformationProcessor