PHP Class eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField

Inheritance: extends eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action
Datei anzeigen Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper
$fieldDefinition eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition Field definition of the field to add.
$fieldValueConverter eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter Field value converter.
$storageHandler eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler Storage handler.

Public Methods

Method Description
__construct ( Gateway $contentGateway, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef, eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter $converter, StorageHandler $storageHandler, Mapper $contentMapper ) Creates a new action.
apply ( integer $contentId ) Applies the action to the given $content.

Protected Methods

Method Description
createField ( null | integer $id, integer $versionNo, string $languageCode ) : eZ\Publish\SPI\Persistence\Content\Field Creates new Field value object, setting given parameters and default value for a field definition the action is constructed for.
insertField ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Field $field ) : integer Inserts given $field to the internal and external storage.

Method Details

__construct() public method

Creates a new action.
public __construct ( Gateway $contentGateway, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef, eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter $converter, StorageHandler $storageHandler, Mapper $contentMapper )
$contentGateway eZ\Publish\Core\Persistence\Legacy\Content\Gateway
$fieldDef eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$converter eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter
$storageHandler eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler
$contentMapper eZ\Publish\Core\Persistence\Legacy\Content\Mapper

apply() public method

Applies the action to the given $content.
public apply ( integer $contentId )
$contentId integer

createField() protected method

Creates new Field value object, setting given parameters and default value for a field definition the action is constructed for.
protected createField ( null | integer $id, integer $versionNo, string $languageCode ) : eZ\Publish\SPI\Persistence\Content\Field
$id null | integer
$versionNo integer
$languageCode string
return eZ\Publish\SPI\Persistence\Content\Field

insertField() protected method

If $field->id is null, creating new field id will be created. Otherwise it will be inserted for the given $content version, reusing existing Field id.
protected insertField ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Field $field ) : integer
$content eZ\Publish\SPI\Persistence\Content
$field eZ\Publish\SPI\Persistence\Content\Field
return integer The ID of the field that was inserted

Property Details

$contentMapper protected_oe property

protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content $contentMapper
return eZ\Publish\Core\Persistence\Legacy\Content\Mapper

$fieldDefinition protected_oe property

Field definition of the field to add.
protected FieldDefinition,eZ\Publish\SPI\Persistence\Content\Type $fieldDefinition
return eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

$fieldValueConverter protected_oe property

Field value converter.
protected Converter,eZ\Publish\Core\Persistence\Legacy\Content\FieldValue $fieldValueConverter
return eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter

$storageHandler protected_oe property

Storage handler.
protected StorageHandler,eZ\Publish\Core\Persistence\Legacy\Content $storageHandler
return eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler