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

Performs mapping of Content objects.
Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$converterRegistry eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry FieldValue converter registry.
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler Caching language handler.

Public Methods

Method Description
__construct ( ConverterRegistry $converterRegistry, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler ) Creates a new mapper.
convertToStorageValue ( eZ\Publish\SPI\Persistence\Content\Field $field ) : StorageFieldValue Converts value of $field to storage value.
createCreateStructFromContent ( eZ\Publish\SPI\Persistence\Content $content ) : eZ\Publish\SPI\Persistence\Content\CreateStruct Creates CreateStruct from $content.
createRelationFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Relation Creates a Content from the given $struct.
createVersionInfoForContent ( eZ\Publish\SPI\Persistence\Content $content, mixed $versionNo, mixed $userId ) : eZ\Publish\SPI\Persistence\Content\VersionInfo Creates a new version for the given $content.
createVersionInfoFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\CreateStruct $struct, mixed $versionNo ) : eZ\Publish\SPI\Persistence\Content\VersionInfo Creates a new version for the given $struct and $versionNo.
extractContentFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content[] Extracts Content objects (and nested) from database result $rows.
extractContentInfoFromRow ( array $row, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_' ) : eZ\Publish\SPI\Persistence\Content\ContentInfo Extracts a ContentInfo object from $row.
extractContentInfoFromRows ( array $rows, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_' ) : eZ\Publish\SPI\Persistence\Content\ContentInfo[] Extracts ContentInfo objects from $rows.
extractLanguageIdsFromMask ( integer $languageMask ) : array
extractRelationsFromRows ( array $rows ) Extracts relation objects from $rows.
extractVersionInfoListFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[] Extracts a VersionInfo object from $row.

Protected Methods

Method Description
extractFieldFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Field Extracts a Field from $row.
extractFieldValueFromRow ( array $row, string $type ) : eZ\Publish\SPI\Persistence\Content\FieldValue Extracts a FieldValue of $type from $row.
extractRelationFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Relation Extracts a Relation object from a $row.

Private Methods

Method Description
createContentInfoFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\CreateStruct $struct, mixed $currentVersionNo = 1 ) : eZ\Publish\SPI\Persistence\Content\ContentInfo Creates a Content from the given $struct and $currentVersionNo.
extractVersionInfoFromRow ( array $row, array $names = [] ) : eZ\Publish\SPI\Persistence\Content\VersionInfo Extracts a VersionInfo object from $row.

Method Details

__construct() public method

Creates a new mapper.
public __construct ( ConverterRegistry $converterRegistry, eZ\Publish\SPI\Persistence\Content\Language\Handler $languageHandler )
$converterRegistry eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry
$languageHandler eZ\Publish\SPI\Persistence\Content\Language\Handler

convertToStorageValue() public method

Converts value of $field to storage value.
public convertToStorageValue ( eZ\Publish\SPI\Persistence\Content\Field $field ) : StorageFieldValue
$field eZ\Publish\SPI\Persistence\Content\Field
return StorageFieldValue

createCreateStructFromContent() public method

Creates CreateStruct from $content.
public createCreateStructFromContent ( eZ\Publish\SPI\Persistence\Content $content ) : eZ\Publish\SPI\Persistence\Content\CreateStruct
$content eZ\Publish\SPI\Persistence\Content
return eZ\Publish\SPI\Persistence\Content\CreateStruct

createRelationFromCreateStruct() public method

Creates a Content from the given $struct.
public createRelationFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Relation
$struct eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Relation

createVersionInfoForContent() public method

Creates a new version for the given $content.
public createVersionInfoForContent ( eZ\Publish\SPI\Persistence\Content $content, mixed $versionNo, mixed $userId ) : eZ\Publish\SPI\Persistence\Content\VersionInfo
$content eZ\Publish\SPI\Persistence\Content
$versionNo mixed
$userId mixed
return eZ\Publish\SPI\Persistence\Content\VersionInfo

createVersionInfoFromCreateStruct() public method

Creates a new version for the given $struct and $versionNo.
public createVersionInfoFromCreateStruct ( eZ\Publish\SPI\Persistence\Content\CreateStruct $struct, mixed $versionNo ) : eZ\Publish\SPI\Persistence\Content\VersionInfo
$struct eZ\Publish\SPI\Persistence\Content\CreateStruct
$versionNo mixed
return eZ\Publish\SPI\Persistence\Content\VersionInfo

extractContentFromRows() public method

Expects database rows to be indexed by keys of the format "$tableName_$columnName"
public extractContentFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content[]
$rows array
$nameRows array
return eZ\Publish\SPI\Persistence\Content[]

extractContentInfoFromRow() public method

Extracts a ContentInfo object from $row.
public extractContentInfoFromRow ( array $row, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_' ) : eZ\Publish\SPI\Persistence\Content\ContentInfo
$row array
$prefix string Prefix for row keys, which are initially mapped by ezcontentobject fields
$treePrefix string Prefix for tree row key, which are initially mapped by ezcontentobject_tree_ fields
return eZ\Publish\SPI\Persistence\Content\ContentInfo

extractContentInfoFromRows() public method

Extracts ContentInfo objects from $rows.
public extractContentInfoFromRows ( array $rows, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_' ) : eZ\Publish\SPI\Persistence\Content\ContentInfo[]
$rows array
$prefix string Prefix for row keys, which are initially mapped by ezcontentobject fields
$treePrefix string Prefix for tree row key, which are initially mapped by ezcontentobject_tree_ fields
return eZ\Publish\SPI\Persistence\Content\ContentInfo[]

extractFieldFromRow() protected method

Extracts a Field from $row.
protected extractFieldFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Field
$row array
return eZ\Publish\SPI\Persistence\Content\Field

extractFieldValueFromRow() protected method

Extracts a FieldValue of $type from $row.
protected extractFieldValueFromRow ( array $row, string $type ) : eZ\Publish\SPI\Persistence\Content\FieldValue
$row array
$type string
return eZ\Publish\SPI\Persistence\Content\FieldValue

extractLanguageIdsFromMask() public method

public extractLanguageIdsFromMask ( integer $languageMask ) : array
$languageMask integer
return array

extractRelationFromRow() protected method

Extracts a Relation object from a $row.
protected extractRelationFromRow ( array $row ) : eZ\Publish\SPI\Persistence\Content\Relation
$row array Associative array representing a relation
return eZ\Publish\SPI\Persistence\Content\Relation

extractRelationsFromRows() public method

Extracts relation objects from $rows.
public extractRelationsFromRows ( array $rows )
$rows array

extractVersionInfoListFromRows() public method

Extracts a VersionInfo object from $row.
public extractVersionInfoListFromRows ( array $rows, array $nameRows ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[]
$rows array
$nameRows array
return eZ\Publish\SPI\Persistence\Content\VersionInfo[]

Property Details

$converterRegistry protected_oe property

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

$languageHandler protected_oe property

Caching language handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Language $languageHandler
return eZ\Publish\SPI\Persistence\Content\Language\Handler