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.
파일 보기 프로젝트 열기: ezsystems/ezpublish-kernel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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