PHP Class eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper

Performs mapping of Type objects.
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$converterRegistry eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry Converter registry.

Public Methods

Method Description
__construct ( ConverterRegistry $converterRegistry ) Creates a new content type mapper.
createCreateStructFromType ( eZ\Publish\SPI\Persistence\Content\Type $type ) : eZ\Publish\SPI\Persistence\Content\Type\CreateStruct Creates a create struct from an existing $type.
createGroupFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Type\Group Creates a Group from its create struct.
createTypeFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Type Maps properties from $struct to $type.
createUpdateStructFromType ( eZ\Publish\SPI\Persistence\Content\Type $type ) : eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct Creates an update struct from an existing $type.
extractFieldFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition Creates a FieldDefinition from the data in $row.
extractGroupsFromRows ( array $rows ) : eZ\Publish\SPI\Persistence\Content\Type\Group[] Extracts Group objects from the given $rows.
extractTypesFromRows ( array $rows ) : array(Type) Extracts types and related data from the given $rows.
toFieldDefinition ( StorageFieldDefinition $storageFieldDef, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef ) Maps a FieldDefinition from the given $storageFieldDef.
toStorageFieldDefinition ( eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef, StorageFieldDefinition $storageFieldDef ) Maps $fieldDef to the legacy storage specific StorageFieldDefinition.

Protected Methods

Method Description
extractStorageFieldFromRow ( array $row ) : StorageFieldDefinition Extracts a StorageFieldDefinition from $row.
extractTypeFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Type Creates a Type from the data in $row.

Method Details

__construct() public method

Creates a new content type mapper.
public __construct ( ConverterRegistry $converterRegistry )
$converterRegistry eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry

createCreateStructFromType() public method

Creates a create struct from an existing $type.
public createCreateStructFromType ( eZ\Publish\SPI\Persistence\Content\Type $type ) : eZ\Publish\SPI\Persistence\Content\Type\CreateStruct
$type eZ\Publish\SPI\Persistence\Content\Type
return eZ\Publish\SPI\Persistence\Content\Type\CreateStruct

createGroupFromCreateStruct() public method

Creates a Group from its create struct.
public createGroupFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Type\Group
$struct eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Type\Group

createTypeFromCreateStruct() public method

Maps properties from $struct to $type.
public createTypeFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Type
$createStruct eZ\Publish\SPI\Persistence\Content\Type\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Type

createUpdateStructFromType() public method

Creates an update struct from an existing $type.
public createUpdateStructFromType ( eZ\Publish\SPI\Persistence\Content\Type $type ) : eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct
$type eZ\Publish\SPI\Persistence\Content\Type
return eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct

extractFieldFromRow() public method

Creates a FieldDefinition from the data in $row.
public extractFieldFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$row array
return eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

extractGroupsFromRows() public method

Extracts Group objects from the given $rows.
public extractGroupsFromRows ( array $rows ) : eZ\Publish\SPI\Persistence\Content\Type\Group[]
$rows array
return eZ\Publish\SPI\Persistence\Content\Type\Group[]

extractStorageFieldFromRow() protected method

Extracts a StorageFieldDefinition from $row.
protected extractStorageFieldFromRow ( array $row ) : StorageFieldDefinition
$row array
return eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition

extractTypeFromRow() protected method

Creates a Type from the data in $row.
protected extractTypeFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Type
$row array
return eZ\Publish\SPI\Persistence\Content\Type

extractTypesFromRows() public method

Extracts types and related data from the given $rows.
public extractTypesFromRows ( array $rows ) : array(Type)
$rows array
return array(Type)

toFieldDefinition() public method

Maps a FieldDefinition from the given $storageFieldDef.
public toFieldDefinition ( StorageFieldDefinition $storageFieldDef, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef )
$storageFieldDef eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition
$fieldDef eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

toStorageFieldDefinition() public method

Maps $fieldDef to the legacy storage specific StorageFieldDefinition.
public toStorageFieldDefinition ( eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDef, StorageFieldDefinition $storageFieldDef )
$fieldDef eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$storageFieldDef eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition

Property Details

$converterRegistry protected property

Converter registry.
protected ConverterRegistry,eZ\Publish\Core\Persistence\Legacy\Content\FieldValue $converterRegistry
return eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry