PHP Класс eZ\Publish\Core\Repository\Helper\NameSchemaService

This code supports content name pattern groups. Syntax: <attribute_identifier> <attribute_identifier> <2nd-identifier> User text <attribute_identifier>|(<2nd-identifier><3rd-identifier>) Example: <nickname|(<firstname> <lastname>)> Tokens are looked up from left to right. If a match is found for the leftmost token, the 2nd token will not be used. Tokens are representations of fields. So a match means that that the current field has data. Tokens are the field definition identifiers which are used in the class edit-interface.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$contentTypeDomainMapper ContentTypeDomainMapper
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$nameableFieldTypeRegistry NameableFieldTypeRegistry
$settings array

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

Метод Описание
__construct ( eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, ContentTypeDomainMapper $contentTypeDomainMapper, NameableFieldTypeRegistry $nameableFieldTypeRegistry, array $settings = [] ) Constructs a object to resolve $nameSchema with $contentVersion fields values.
resolve ( string $nameSchema, eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $fieldMap, array $languageCodes ) : string Returns the real name for a content name pattern.
resolveNameSchema ( eZ\Publish\API\Repository\Values\Content\Content $content, array $fieldMap = [], array $languageCodes = [], eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType = null ) : array Convenience method for resolving name schema.
resolveUrlAliasSchema ( eZ\Publish\API\Repository\Values\Content\Content $content, eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType = null ) : array Convenience method for resolving URL alias schema.

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

Метод Описание
extractTokens ( string $nameSchema ) : array Extract all tokens from $namePattern.
filterNameSchema ( string $nameSchema ) : string Builds a lookup / translation table for groups in the $namePattern.
getFieldTitles ( array $schemaIdentifiers, eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $fieldMap, string $languageCode ) : string[] Fetches the list of available Field identifiers in the token and returns an array of their current title value.
getIdentifiers ( string $schemaString ) : array Returns all identifiers from all tokens in the name schema.
isTokenGroup ( string $identifier ) : boolean Checks whether $identifier is a placeholder for a token group.
mergeFieldMap ( eZ\Publish\API\Repository\Values\Content\Content $content, array $fieldMap, array $languageCodes ) : array Convenience method for resolving name schema.
resolveToken ( string $token, array $titles, array $groupLookupTable ) : string Looks up the value $token should be replaced with and returns this as a string. Meta strings denoting token groups are automatically inferred.
tokenParts ( string $token ) : array Returns the different constituents of $token in an array.

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

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

Constructs a object to resolve $nameSchema with $contentVersion fields values.
public __construct ( eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, ContentTypeDomainMapper $contentTypeDomainMapper, NameableFieldTypeRegistry $nameableFieldTypeRegistry, array $settings = [] )
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$contentTypeDomainMapper ContentTypeDomainMapper
$nameableFieldTypeRegistry NameableFieldTypeRegistry
$settings array

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

Example: Text <token> more text ==> <token>
protected extractTokens ( string $nameSchema ) : array
$nameSchema string
Результат array

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

The groups are referenced with a generated meta-token in the original name pattern. Returns intermediate name pattern where groups are replaced with meta- tokens.
protected filterNameSchema ( string $nameSchema ) : string
$nameSchema string
Результат string

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

Fetches the list of available Field identifiers in the token and returns an array of their current title value.
См. также: eZ\Publish\Core\Repository\FieldType::getName()
protected getFieldTitles ( array $schemaIdentifiers, eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $fieldMap, string $languageCode ) : string[]
$schemaIdentifiers array
$contentType eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType
$fieldMap array
$languageCode string
Результат string[] Key is the field identifier, value is the title value

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

Returns all identifiers from all tokens in the name schema.
protected getIdentifiers ( string $schemaString ) : array
$schemaString string
Результат array

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

Checks whether $identifier is a placeholder for a token group.
protected isTokenGroup ( string $identifier ) : boolean
$identifier string
Результат boolean

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

Convenience method for resolving name schema.
protected mergeFieldMap ( eZ\Publish\API\Repository\Values\Content\Content $content, array $fieldMap, array $languageCodes ) : array
$content eZ\Publish\API\Repository\Values\Content\Content
$fieldMap array
$languageCodes array
Результат array

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

Returns the real name for a content name pattern.
public resolve ( string $nameSchema, eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $fieldMap, array $languageCodes ) : string
$nameSchema string
$contentType eZ\Publish\SPI\Persistence\Content\Type | eZ\Publish\API\Repository\Values\ContentType\ContentType
$fieldMap array
$languageCodes array
Результат string

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

Convenience method for resolving name schema.
public resolveNameSchema ( eZ\Publish\API\Repository\Values\Content\Content $content, array $fieldMap = [], array $languageCodes = [], eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType = null ) : array
$content eZ\Publish\API\Repository\Values\Content\Content
$fieldMap array
$languageCodes array
$contentType eZ\Publish\API\Repository\Values\ContentType\ContentType
Результат array

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

Looks up the value $token should be replaced with and returns this as a string. Meta strings denoting token groups are automatically inferred.
protected resolveToken ( string $token, array $titles, array $groupLookupTable ) : string
$token string
$titles array
$groupLookupTable array
Результат string

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

Convenience method for resolving URL alias schema.
public resolveUrlAliasSchema ( eZ\Publish\API\Repository\Values\Content\Content $content, eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType = null ) : array
$content eZ\Publish\API\Repository\Values\Content\Content
$contentType eZ\Publish\API\Repository\Values\ContentType\ContentType
Результат array

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

The normal case here is that the different identifiers within one token will be tokenized and returned. Example: "<title|text>" ==> array( 'title', 'text' )
protected tokenParts ( string $token ) : array
$token string
Результат array

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

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

protected ContentTypeDomainMapper,eZ\Publish\Core\Repository\Helper $contentTypeDomainMapper
Результат ContentTypeDomainMapper

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

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

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

protected NameableFieldTypeRegistry,eZ\Publish\Core\Repository\Helper $nameableFieldTypeRegistry
Результат NameableFieldTypeRegistry

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

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