Class

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

class Mapper

Mapper for Content Handler.

Performs mapping of Content objects.

Methods

__construct(ConverterRegistry $converterRegistry, Handler $languageHandler)

Creates a new mapper.

VersionInfo createVersionInfoFromCreateStruct(CreateStruct $struct, mixed $versionNo)

Creates a new version for the given $struct and $versionNo.

VersionInfo createVersionInfoForContent(Content $content, mixed $versionNo, mixed $userId)

Creates a new version for the given $content.

StorageFieldValue convertToStorageValue(Field $field)

Converts value of $field to storage value.

Content[] extractContentFromRows(array $rows, array $nameRows)

Extracts Content objects (and nested) from database result $rows.

ContentInfo extractContentInfoFromRow(array $row, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_')

Extracts a ContentInfo object from $row.

ContentInfo[] extractContentInfoFromRows(array $rows, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_')

Extracts ContentInfo objects from $rows.

VersionInfo[] extractVersionInfoListFromRows(array $rows, array $nameRows)

Extracts a VersionInfo object from $row.

string[] extractLanguageCodesFromMask(int $languageMask)

CreateStruct createCreateStructFromContent(Content $content)

Creates CreateStruct from $content.

extractRelationsFromRows(array $rows)

Extracts relation objects from $rows.

Relation createRelationFromCreateStruct(CreateStruct $struct)

Creates a Content from the given $struct.

Details

at line 49
public __construct(ConverterRegistry $converterRegistry, Handler $languageHandler)

Creates a new mapper.

Parameters

ConverterRegistry $converterRegistry
Handler $languageHandler

at line 96
public VersionInfo createVersionInfoFromCreateStruct(CreateStruct $struct, mixed $versionNo)

Creates a new version for the given $struct and $versionNo.

Parameters

CreateStruct $struct
mixed $versionNo

Return Value

VersionInfo

at line 130
public VersionInfo createVersionInfoForContent(Content $content, mixed $versionNo, mixed $userId)

Creates a new version for the given $content.

Parameters

Content $content
mixed $versionNo
mixed $userId

Return Value

VersionInfo

at line 154
public StorageFieldValue convertToStorageValue(Field $field)

Converts value of $field to storage value.

Parameters

Field $field

Return Value

StorageFieldValue

at line 180
public Content[] extractContentFromRows(array $rows, array $nameRows)

Extracts Content objects (and nested) from database result $rows.

Expects database rows to be indexed by keys of the format

 "$tableName_$columnName"

Parameters

array $rows
array $nameRows

Return Value

Content[]

at line 244
public ContentInfo extractContentInfoFromRow(array $row, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_')

Extracts a ContentInfo object from $row.

Parameters

array $row
string $prefix Prefix for row keys, which are initially mapped by ezcontentobject fields
string $treePrefix Prefix for tree row key, which are initially mapped by ezcontentobjecttree fields

Return Value

ContentInfo

at line 273
public ContentInfo[] extractContentInfoFromRows(array $rows, string $prefix = '', string $treePrefix = 'ezcontentobject_tree_')

Extracts ContentInfo objects from $rows.

Parameters

array $rows
string $prefix Prefix for row keys, which are initially mapped by ezcontentobject fields
string $treePrefix Prefix for tree row key, which are initially mapped by ezcontentobjecttree fields

Return Value

ContentInfo[]

at line 319
public VersionInfo[] extractVersionInfoListFromRows(array $rows, array $nameRows)

Extracts a VersionInfo object from $row.

Parameters

array $rows
array $nameRows

Return Value

VersionInfo[]

at line 354
public string[] extractLanguageCodesFromMask(int $languageMask)

Parameters

int $languageMask

Return Value

string[]

at line 435
public CreateStruct createCreateStructFromContent(Content $content)

Creates CreateStruct from $content.

Parameters

Content $content

Return Value

CreateStruct

at line 461
public extractRelationsFromRows(array $rows)

Extracts relation objects from $rows.

Parameters

array $rows

at line 506
public Relation createRelationFromCreateStruct(CreateStruct $struct)

Creates a Content from the given $struct.

Parameters

CreateStruct $struct

Return Value

Relation