eZPublishCommunityProject  2013.4
eZ\Publish\Core\Persistence\Legacy\Content\Mapper Class Reference

Mapper for Content Handler. More...

Public Member Functions

 __construct (Registry $converterRegistry, LanguageHandler $languageHandler)
 Creates a new mapper. More...
 
 convertToStorageValue (Field $field)
 Converts value of $field to storage value. More...
 
 createCreateStructFromContent (Content $content)
 Creates CreateStruct from $content. More...
 
 createRelationFromCreateStruct (RelationCreateStruct $struct)
 Creates a Content from the given $struct. More...
 
 createVersionInfoForContent (Content $content, $versionNo, $userId)
 Creates a new version for the given $content. More...
 
 createVersionInfoFromCreateStruct (CreateStruct $struct, $versionNo)
 Creates a new version for the given $struct and $versionNo. More...
 
 extractContentFromRows (array $rows)
 Extracts Content objects (and nested) from database result $rows. More...
 
 extractContentInfoFromRow (array $row, $prefix= '')
 Extracts a ContentInfo object from $row. More...
 
 extractLanguageIdsFromMask ($languageMask)
 
 extractRelationsFromRows (array $rows)
 Extracts relation objects from $rows. More...
 
 extractVersionInfoListFromRows (array $rows)
 Extracts a VersionInfo object from $row. More...
 

Protected Member Functions

 extractFieldFromRow (array $row)
 Extracts a Field from $row. More...
 
 extractFieldValueFromRow (array $row, $type)
 Extracts a FieldValue of $type from $row. More...
 
 extractRelationFromRow (array $row)
 Extracts a Relation object from a $row. More...
 

Protected Attributes

 $converterRegistry
 
 $languageHandler
 

Private Member Functions

 createContentInfoFromCreateStruct (CreateStruct $struct, $currentVersionNo=1)
 Creates a Content from the given $struct and $currentVersionNo. More...
 
 extractVersionInfoFromRow (array $row)
 Extracts a VersionInfo object from $row. More...
 

Detailed Description

Mapper for Content Handler.

Performs mapping of Content objects.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::__construct ( Registry  $converterRegistry,
LanguageHandler  $languageHandler 
)

Creates a new mapper.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry$converterRegistry
\eZ\Publish\SPI\Persistence\Content\Language\Handler$languageHandler

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::convertToStorageValue ( Field  $field)

Converts value of $field to storage value.

Parameters
\eZ\Publish\SPI\Persistence\Content\Field$field
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createContentInfoFromCreateStruct ( CreateStruct  $struct,
  $currentVersionNo = 1 
)
private

Creates a Content from the given $struct and $currentVersionNo.

Parameters
\eZ\Publish\SPI\Persistence\Content\CreateStruct$struct
mixed$currentVersionNo
Returns

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Mapper\createVersionInfoFromCreateStruct().

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createCreateStructFromContent ( Content  $content)

Creates CreateStruct from $content.

Parameters
\eZ\Publish\SPI\Persistence\Content$content
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createRelationFromCreateStruct ( RelationCreateStruct  $struct)

Creates a Content from the given $struct.

Parameters
\eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct$struct
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createVersionInfoForContent ( Content  $content,
  $versionNo,
  $userId 
)

Creates a new version for the given $content.

Parameters
\eZ\Publish\SPI\Persistence\Content$content
mixed$versionNo
mixed$userId
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::createVersionInfoFromCreateStruct ( CreateStruct  $struct,
  $versionNo 
)

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

Parameters
\eZ\Publish\SPI\Persistence\Content\CreateStruct$struct
mixed$versionNo
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractContentFromRows ( array  $rows)

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
Returns
[]
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractContentInfoFromRow ( array  $row,
  $prefix = '' 
)

Extracts a ContentInfo object from $row.

Parameters
array$row
string$prefixPrefix for row keys, which are initially mapped by ezcontentobject fields
Returns

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Mapper\extractContentFromRows(), and eZ\Publish\Core\Persistence\Legacy\Content\Mapper\extractVersionInfoListFromRows().

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractFieldFromRow ( array  $row)
protected
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractFieldValueFromRow ( array  $row,
  $type 
)
protected

Extracts a FieldValue of $type from $row.

Parameters
array$row
string$type
Returns
Exceptions
\eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\Exception\NotFoundif the necessary converter for $type could not be found.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Mapper\extractFieldFromRow().

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractLanguageIdsFromMask (   $languageMask)
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractRelationFromRow ( array  $row)
protected

Extracts a Relation object from a $row.

Parameters
array$rowAssociative array representing a relation
Returns

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Mapper\extractRelationsFromRows().

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractRelationsFromRows ( array  $rows)

Extracts relation objects from $rows.

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractVersionInfoFromRow ( array  $row)
private

Extracts a VersionInfo object from $row.

This method will return VersionInfo with incomplete data. It is intended to be used only by self::extractContentFromRows where missing data will be filled in.

Parameters
array$row
Returns

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Mapper\extractContentFromRows().

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractVersionInfoListFromRows ( array  $rows)

Extracts a VersionInfo object from $row.

Parameters
array$rows
Returns
[]

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Mapper::$converterRegistry
protected
eZ\Publish\Core\Persistence\Legacy\Content\Mapper::$languageHandler
protected

The documentation for this class was generated from the following file: