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

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

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

Свойство Тип Описание
$contentHandler eZ\Publish\SPI\Persistence\Content\Handler
$contentLanguageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$fieldTypeRegistry FieldTypeRegistry
$locationHandler eZ\Publish\SPI\Persistence\Content\Location\Handler

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

Метод Описание
__construct ( eZ\Publish\SPI\Persistence\Content\Handler $contentHandler, eZ\Publish\SPI\Persistence\Content\Location\Handler $locationHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, eZ\Publish\SPI\Persistence\Content\Language\Handler $contentLanguageHandler, FieldTypeRegistry $fieldTypeRegistry ) Setups service with reference to repository.
buildContentDomainObject ( eZ\Publish\SPI\Persistence\Content $spiContent, eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type $contentType = null, array $fieldLanguages = null, string | null $fieldAlwaysAvailableLanguage = null ) : Content Builds a Content domain object from value object returned from persistence.
buildContentInfoDomainObject ( eZ\Publish\SPI\Persistence\Content\ContentInfo $spiContentInfo ) : eZ\Publish\API\Repository\Values\Content\ContentInfo Builds a ContentInfo domain object from value object returned from persistence.
buildDomainFields ( array $spiFields, eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type $contentType, array $languages = null, string | null $alwaysAvailableLanguage = null ) : array Returns an array of domain fields created from given array of SPI fields.
buildLocationDomainObject ( eZ\Publish\SPI\Persistence\Content\Location $spiLocation ) : eZ\Publish\API\Repository\Values\Content\Location Builds domain location object from provided persistence location.
buildRelationDomainObject ( eZ\Publish\SPI\Persistence\Content\Relation $spiRelation, eZ\Publish\API\Repository\Values\Content\ContentInfo $sourceContentInfo, eZ\Publish\API\Repository\Values\Content\ContentInfo $destinationContentInfo ) : eZ\Publish\API\Repository\Values\Content\Relation Builds API Relation object from provided SPI Relation object.
buildSPILocationCreateStruct ( eZ\Publish\API\Repository\Values\Content\LocationCreateStruct $locationCreateStruct, eZ\Publish\API\Repository\Values\Content\Location $parentLocation, mixed $mainLocation, mixed $contentId, mixed $contentVersionNo ) : eZ\Publish\SPI\Persistence\Content\Location\CreateStruct Creates an array of SPI location create structs from given array of API location create structs.
buildVersionInfoDomainObject ( eZ\Publish\SPI\Persistence\Content\VersionInfo $spiVersionInfo ) : VersionInfo Builds a VersionInfo domain object from value object returned from persistence.
getDateTime ( integer $timestamp ) : DateTime Returns \DateTime object from given $timestamp in environment timezone.
getUniqueHash ( object $object ) : string Creates unique hash string for given $object.
isValidLocationSortField ( mixed $sortField ) : boolean Checks if given $sortField value is one of the defined sort field constants.
isValidLocationSortOrder ( mixed $sortOrder ) : boolean Checks if given $sortOrder value is one of the defined sort order constants.
validateTranslatedList ( mixed $list, string $argumentName ) Validates given translated list $list, which should be an array of strings with language codes as keys.

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

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

Setups service with reference to repository.
public __construct ( eZ\Publish\SPI\Persistence\Content\Handler $contentHandler, eZ\Publish\SPI\Persistence\Content\Location\Handler $locationHandler, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, eZ\Publish\SPI\Persistence\Content\Language\Handler $contentLanguageHandler, FieldTypeRegistry $fieldTypeRegistry )
$contentHandler eZ\Publish\SPI\Persistence\Content\Handler
$locationHandler eZ\Publish\SPI\Persistence\Content\Location\Handler
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$contentLanguageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$fieldTypeRegistry FieldTypeRegistry

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

Builds a Content domain object from value object returned from persistence.
public buildContentDomainObject ( eZ\Publish\SPI\Persistence\Content $spiContent, eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type $contentType = null, array $fieldLanguages = null, string | null $fieldAlwaysAvailableLanguage = null ) : Content
$spiContent eZ\Publish\SPI\Persistence\Content
$contentType eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type
$fieldLanguages array Language codes to filter fields on
$fieldAlwaysAvailableLanguage string | null Language code fallback if a given field is not found in $fieldLanguages
Результат eZ\Publish\Core\Repository\Values\Content\Content

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

Builds a ContentInfo domain object from value object returned from persistence.
public buildContentInfoDomainObject ( eZ\Publish\SPI\Persistence\Content\ContentInfo $spiContentInfo ) : eZ\Publish\API\Repository\Values\Content\ContentInfo
$spiContentInfo eZ\Publish\SPI\Persistence\Content\ContentInfo
Результат eZ\Publish\API\Repository\Values\Content\ContentInfo

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

Returns an array of domain fields created from given array of SPI fields.
public buildDomainFields ( array $spiFields, eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type $contentType, array $languages = null, string | null $alwaysAvailableLanguage = null ) : array
$spiFields array
$contentType eZ\Publish\API\Repository\Values\ContentType\ContentType | eZ\Publish\SPI\Persistence\Content\Type
$languages array Language codes to filter fields on
$alwaysAvailableLanguage string | null Language code fallback if a given field is not found in $languages
Результат array

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

Builds domain location object from provided persistence location.
public buildLocationDomainObject ( eZ\Publish\SPI\Persistence\Content\Location $spiLocation ) : eZ\Publish\API\Repository\Values\Content\Location
$spiLocation eZ\Publish\SPI\Persistence\Content\Location
Результат eZ\Publish\API\Repository\Values\Content\Location

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

Builds API Relation object from provided SPI Relation object.
public buildRelationDomainObject ( eZ\Publish\SPI\Persistence\Content\Relation $spiRelation, eZ\Publish\API\Repository\Values\Content\ContentInfo $sourceContentInfo, eZ\Publish\API\Repository\Values\Content\ContentInfo $destinationContentInfo ) : eZ\Publish\API\Repository\Values\Content\Relation
$spiRelation eZ\Publish\SPI\Persistence\Content\Relation
$sourceContentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$destinationContentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
Результат eZ\Publish\API\Repository\Values\Content\Relation

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

Creates an array of SPI location create structs from given array of API location create structs.
public buildSPILocationCreateStruct ( eZ\Publish\API\Repository\Values\Content\LocationCreateStruct $locationCreateStruct, eZ\Publish\API\Repository\Values\Content\Location $parentLocation, mixed $mainLocation, mixed $contentId, mixed $contentVersionNo ) : eZ\Publish\SPI\Persistence\Content\Location\CreateStruct
$locationCreateStruct eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
$parentLocation eZ\Publish\API\Repository\Values\Content\Location
$mainLocation mixed
$contentId mixed
$contentVersionNo mixed
Результат eZ\Publish\SPI\Persistence\Content\Location\CreateStruct

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

Builds a VersionInfo domain object from value object returned from persistence.
public buildVersionInfoDomainObject ( eZ\Publish\SPI\Persistence\Content\VersionInfo $spiVersionInfo ) : VersionInfo
$spiVersionInfo eZ\Publish\SPI\Persistence\Content\VersionInfo
Результат eZ\Publish\Core\Repository\Values\Content\VersionInfo

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

This method is needed because constructing \DateTime with $timestamp will return the object in UTC timezone.
public getDateTime ( integer $timestamp ) : DateTime
$timestamp integer
Результат DateTime

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

Used for remoteId.
public getUniqueHash ( object $object ) : string
$object object
Результат string

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

Checks if given $sortField value is one of the defined sort field constants.
public isValidLocationSortField ( mixed $sortField ) : boolean
$sortField mixed
Результат boolean

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

Checks if given $sortOrder value is one of the defined sort order constants.
public isValidLocationSortOrder ( mixed $sortOrder ) : boolean
$sortOrder mixed
Результат boolean

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

Validates given translated list $list, which should be an array of strings with language codes as keys.
public validateTranslatedList ( mixed $list, string $argumentName )
$list mixed
$argumentName string

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

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

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

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

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

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

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

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

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

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

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