PHP Class eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler

Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$contentGateway Gateway Content Gateway.
$fieldTypeRegistry eZ\Publish\Core\Persistence\FieldTypeRegistry FieldType registry.
$fieldTypes array Hash of SPI FieldTypes or callable callbacks to generate one.
$languageHandler eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler
$mapper Mapper Content Mapper.
$storageHandler StorageHandler Storage Handler.

Méthodes publiques

Méthode Description
__construct ( Gateway $contentGateway, Mapper $mapper, StorageHandler $storageHandler, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FieldTypeRegistry $fieldTypeRegistry ) Creates a new Field Handler.
createExistingFieldsInNewVersion ( eZ\Publish\SPI\Persistence\Content $content ) Creates existing fields in a new version for $content.
createNewFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Type $contentType ) Creates new fields in the database from $content of $contentType.
deleteFields ( integer $contentId, eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo ) Deletes the fields for $contentId in $versionInfo from the database.
loadExternalFieldData ( eZ\Publish\SPI\Persistence\Content $content ) Performs external loads for the fields in $content.
updateFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\UpdateStruct $updateStruct, eZ\Publish\SPI\Persistence\Content\Type $contentType ) Updates the fields in for content identified by $contentId and $versionNo in the database in respect to $updateStruct.

Méthodes protégées

Méthode Description
copyField ( eZ\Publish\SPI\Persistence\Content\Field $originalField, string $languageCode, eZ\Publish\SPI\Persistence\Content $content ) Copies existing field to new field for given $languageCode.
copyFields ( array $fields, eZ\Publish\SPI\Persistence\Content $content )
createExistingFieldInNewVersion ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content ) Creates an existing field in a new version, no new ID is generated.
createNewField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content ) Creates a new field in the database.
getEmptyField ( eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition, string $languageCode ) : eZ\Publish\SPI\Persistence\Content\Field Returns empty Field object for given field definition and language code.
getFieldMap ( array $fields, array &$languageCodes = null ) : eZ\Publish\SPI\Persistence\Content\Field[][] Returns given $fields structured in hash array with field definition ids and language codes as keys.
getLanguageCodes ( array $languageIds ) : array For given $languageIds returns array with language codes as keys.
updateCopiedField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content\Field $updateField, eZ\Publish\SPI\Persistence\Content\Field $originalField, eZ\Publish\SPI\Persistence\Content $content ) Updates a language copy of a non-translatable field.
updateField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content ) Updates an existing field in the database.

Method Details

__construct() public méthode

Creates a new Field Handler.
public __construct ( Gateway $contentGateway, Mapper $mapper, StorageHandler $storageHandler, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler, FieldTypeRegistry $fieldTypeRegistry )
$contentGateway Gateway
$mapper Mapper
$storageHandler StorageHandler
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler
$fieldTypeRegistry eZ\Publish\Core\Persistence\FieldTypeRegistry

copyField() protected méthode

Used by self::createNewFields() and self::updateFields()
protected copyField ( eZ\Publish\SPI\Persistence\Content\Field $originalField, string $languageCode, eZ\Publish\SPI\Persistence\Content $content )
$originalField eZ\Publish\SPI\Persistence\Content\Field
$languageCode string
$content eZ\Publish\SPI\Persistence\Content

copyFields() protected méthode

protected copyFields ( array $fields, eZ\Publish\SPI\Persistence\Content $content )
$fields array
$content eZ\Publish\SPI\Persistence\Content

createExistingFieldInNewVersion() protected méthode

Used to insert a field with an existing ID but a new version number. $content is used for new version data, needed by Content gateway and external storage. External data is being copied here as some FieldTypes require original field external data. By default copying falls back to storing, it is upon external storage implementation to override the behaviour as needed.
protected createExistingFieldInNewVersion ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content )
$field eZ\Publish\SPI\Persistence\Content\Field
$content eZ\Publish\SPI\Persistence\Content

createExistingFieldsInNewVersion() public méthode

Creates existing fields in a new version for $content.
public createExistingFieldsInNewVersion ( eZ\Publish\SPI\Persistence\Content $content )
$content eZ\Publish\SPI\Persistence\Content

createNewField() protected méthode

Used by self::createNewFields() and self::updateFields()
protected createNewField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content )
$field eZ\Publish\SPI\Persistence\Content\Field
$content eZ\Publish\SPI\Persistence\Content

createNewFields() public méthode

Creates new fields in the database from $content of $contentType.
public createNewFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Type $contentType )
$content eZ\Publish\SPI\Persistence\Content
$contentType eZ\Publish\SPI\Persistence\Content\Type

deleteFields() public méthode

Deletes the fields for $contentId in $versionInfo from the database.
public deleteFields ( integer $contentId, eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo )
$contentId integer
$versionInfo eZ\Publish\SPI\Persistence\Content\VersionInfo

getEmptyField() protected méthode

Uses FieldType to create empty field value.
protected getEmptyField ( eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition, string $languageCode ) : eZ\Publish\SPI\Persistence\Content\Field
$fieldDefinition eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$languageCode string
Résultat eZ\Publish\SPI\Persistence\Content\Field

getFieldMap() protected méthode

Returns given $fields structured in hash array with field definition ids and language codes as keys.
protected getFieldMap ( array $fields, array &$languageCodes = null ) : eZ\Publish\SPI\Persistence\Content\Field[][]
$fields array
$languageCodes array
Résultat eZ\Publish\SPI\Persistence\Content\Field[][]

getLanguageCodes() protected méthode

For given $languageIds returns array with language codes as keys.
protected getLanguageCodes ( array $languageIds ) : array
$languageIds array
Résultat array

loadExternalFieldData() public méthode

Performs external loads for the fields in $content.
public loadExternalFieldData ( eZ\Publish\SPI\Persistence\Content $content )
$content eZ\Publish\SPI\Persistence\Content

updateCopiedField() protected méthode

External data is being copied here as some FieldTypes require original field external data. By default copying falls back to storing, it is upon external storage implementation to override the behaviour as needed.
protected updateCopiedField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content\Field $updateField, eZ\Publish\SPI\Persistence\Content\Field $originalField, eZ\Publish\SPI\Persistence\Content $content )
$field eZ\Publish\SPI\Persistence\Content\Field
$updateField eZ\Publish\SPI\Persistence\Content\Field
$originalField eZ\Publish\SPI\Persistence\Content\Field
$content eZ\Publish\SPI\Persistence\Content

updateField() protected méthode

Used by self::createNewFields() and self::updateFields()
protected updateField ( eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content $content )
$field eZ\Publish\SPI\Persistence\Content\Field
$content eZ\Publish\SPI\Persistence\Content

updateFields() public méthode

Updates the fields in for content identified by $contentId and $versionNo in the database in respect to $updateStruct.
public updateFields ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\UpdateStruct $updateStruct, eZ\Publish\SPI\Persistence\Content\Type $contentType )
$content eZ\Publish\SPI\Persistence\Content
$updateStruct eZ\Publish\SPI\Persistence\Content\UpdateStruct
$contentType eZ\Publish\SPI\Persistence\Content\Type

Property Details

$contentGateway protected_oe property

Content Gateway.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content $contentGateway
Résultat Gateway

$fieldTypeRegistry protected_oe property

FieldType registry.
protected FieldTypeRegistry,eZ\Publish\Core\Persistence $fieldTypeRegistry
Résultat eZ\Publish\Core\Persistence\FieldTypeRegistry

$fieldTypes protected_oe property

Hash of SPI FieldTypes or callable callbacks to generate one.
protected array $fieldTypes
Résultat array

$languageHandler protected_oe property

protected Handler,eZ\Publish\Core\Persistence\Legacy\Content\Language $languageHandler
Résultat eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler

$mapper protected_oe property

Content Mapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content $mapper
Résultat Mapper

$storageHandler protected_oe property

Storage Handler.
protected StorageHandler,eZ\Publish\Core\Persistence\Legacy\Content $storageHandler
Résultat StorageHandler