eZPublishCommunityProject  2013.9
eZ\Publish\Core\Persistence\InMemory\ContentHandler Class Reference
+ Inheritance diagram for eZ\Publish\Core\Persistence\InMemory\ContentHandler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\InMemory\ContentHandler:

Public Member Functions

 __construct (Handler $handler, Backend $backend, FieldTypeRegistry $fieldTypeRegistry=null)
 Setups current handler instance with reference to Handler object that created it. More...
 
 addRelation (RelationCreateStruct $relation)
 Creates a relation between $sourceContentId in $sourceContentVersionNo and $destinationContentId with a specific $type. More...
 
 copy ($contentId, $versionNo=null)
 Copy Content with Fields and Versions from $contentId in $version. More...
 
 deleteContent ($contentId)
 
 deleteVersion ($contentId, $versionNo)
 Deletes given version, its fields, node assignment, relations and names. More...
 
 listVersions ($contentId)
 
 load ($id, $version, $translations=null)
 
 loadContentInfo ($contentId)
 Returns the metadata object for a content identified by $contentId. More...
 
 loadContentInfoByRemoteId ($remoteId)
 
 loadDraftsForUser ($userId)
 
 loadRelations ($sourceContentId, $sourceContentVersionNo=null, $type=null)
 Loads relations from $sourceContentId. More...
 
 loadReverseRelations ($destinationContentId, $type=null)
 Loads relations from $contentId. More...
 
 loadVersionInfo ($contentId, $versionNo)
 Returns the version object for a content/version identified by $contentId and $versionNo. More...
 
 publish ($contentId, $versionNo, MetadataUpdateStruct $metaDataUpdateStruct)
 Performs the publishing operations required to set the version identified by $updateStruct->versionNo and $updateStruct->id as the published one. More...
 
 removeRelation ($relationId, $type)
 Removes a relation by relation Id. More...
 
 setStatus ($contentId, $status, $version)
 
 trash ($contentId)
 
 untrash ($contentId)
 
 updateMetadata ($contentId, MetadataUpdateStruct $content)
 
- Public Member Functions inherited from eZ\Publish\SPI\Persistence\Content\Handler
 create (CreateStruct $content)
 Creates a new Content entity in the storage engine. More...
 
 createDraftFromVersion ($contentId, $srcVersion, $userId)
 Creates a new draft version from $contentId in $srcVersion number. More...
 
 updateContent ($contentId, $versionNo, UpdateStruct $content)
 Updates a content version, identified by $contentId and $versionNo. More...
 

Protected Member Functions

 createCompleteFields (CreateStruct $contentCreateStruct, array &$languageCodes, $mainLanguageCode)
 Returns complete set of fields. More...
 
 createField ($field, $contentId, $versionNo=1)
 
 getEmptyField (FieldDefinition $fieldDefinition, $languageCode, $versionNo=1)
 Returns empty Field object for given field definition and language code. More...
 
 getFieldMap (array $fields, array &$languageCodes=null)
 
 getLanguageCodes (array $languageIds)
 For given $languageIds returns array with language codes as keys. More...
 

Protected Attributes

 $backend
 
 $fieldTypeRegistry
 
 $handler
 

Private Member Functions

 getLastVersionNumber ($contentId)
 Returns last version number for content identified by $contentId. More...
 

Detailed Description

See Also
eZ

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\InMemory\ContentHandler::__construct ( Handler  $handler,
Backend  $backend,
FieldTypeRegistry  $fieldTypeRegistry = null 
)

Setups current handler instance with reference to Handler object that created it.

Parameters
\eZ\Publish\Core\Persistence\InMemory\Handler$handler
\eZ\Publish\Core\Persistence\InMemory\Backend$backendThe storage engine backend
\eZ\Publish\Core\Persistence\FieldTypeRegistry$fieldTypeRegistry

Member Function Documentation

eZ\Publish\Core\Persistence\InMemory\ContentHandler::addRelation ( RelationCreateStruct  $relation)

Creates a relation between $sourceContentId in $sourceContentVersionNo and $destinationContentId with a specific $type.

Parameters
\eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct$relation
Returns

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::copy (   $contentId,
  $versionNo = null 
)

Copy Content with Fields and Versions from $contentId in $version.

Copies all fields from $contentId in $version (or all versions if false) to a new object which is returned. Version numbers are maintained.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf content or version is not found
Parameters
mixed$contentId
mixed | null$versionNoCopy all versions if left null
Todo:
Language support
Returns

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::createCompleteFields ( CreateStruct  $contentCreateStruct,
array &  $languageCodes,
  $mainLanguageCode 
)
protected

Returns complete set of fields.

Parameters
\eZ\Publish\SPI\Persistence\Content\CreateStruct$contentCreateStruct
array$languageCodes
string$mainLanguageCode
Returns
[]
eZ\Publish\Core\Persistence\InMemory\ContentHandler::createField (   $field,
  $contentId,
  $versionNo = 1 
)
protected
eZ\Publish\Core\Persistence\InMemory\ContentHandler::deleteContent (   $contentId)
See Also
Todo:
add deleting of relations

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::deleteVersion (   $contentId,
  $versionNo 
)

Deletes given version, its fields, node assignment, relations and names.

Removes the relations, but not the related objects.

Parameters
int$contentId
int$versionNo
Returns
boolean
Todo:
add deleting of relations

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::getEmptyField ( FieldDefinition  $fieldDefinition,
  $languageCode,
  $versionNo = 1 
)
protected

Returns empty Field object for given field definition and language code.

Uses FieldType to create empty field value.

Parameters
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
string$languageCode
int$versionNo
Returns

Referenced by eZ\Publish\Core\Persistence\InMemory\ContentHandler\createCompleteFields().

eZ\Publish\Core\Persistence\InMemory\ContentHandler::getFieldMap ( array  $fields,
array &  $languageCodes = null 
)
protected
Parameters
\eZ\Publish\SPI\Persistence\Content\Field[]$fields
array$languageCodes
Returns
array

Referenced by eZ\Publish\Core\Persistence\InMemory\ContentHandler\createCompleteFields().

eZ\Publish\Core\Persistence\InMemory\ContentHandler::getLanguageCodes ( array  $languageIds)
protected

For given $languageIds returns array with language codes as keys.

Parameters
array$languageIds
Returns
array
eZ\Publish\Core\Persistence\InMemory\ContentHandler::getLastVersionNumber (   $contentId)
private

Returns last version number for content identified by $contentId.

Parameters
int$contentId
Returns
int
eZ\Publish\Core\Persistence\InMemory\ContentHandler::listVersions (   $contentId)
See Also
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf no version found

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::load (   $id,
  $version,
  $translations = null 
)
eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadContentInfo (   $contentId)

Returns the metadata object for a content identified by $contentId.

Parameters
int | string$contentId
Returns

Implements eZ\Publish\SPI\Persistence\Content\Handler.

Referenced by eZ\Publish\Core\Persistence\InMemory\ContentHandler\updateMetadata().

eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadContentInfoByRemoteId (   $remoteId)
eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadDraftsForUser (   $userId)
eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadRelations (   $sourceContentId,
  $sourceContentVersionNo = null,
  $type = null 
)

Loads relations from $sourceContentId.

Optionally, loads only those with $type and $sourceContentVersionNo.

Parameters
mixed$sourceContentIdSource Content ID
mixed | null$sourceContentVersionNoSource Content Version, null if not specified
int | null$type{
See Also
::COMMON, ::EMBED, ::LINK, ::FIELD}
Returns
[]

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadReverseRelations (   $destinationContentId,
  $type = null 
)

Loads relations from $contentId.

Optionally, loads only those with $type.

Only loads relations against published versions.

Parameters
mixed$destinationContentIdDestination Content ID
int | null$type{
See Also
::COMMON, ::EMBED, ::LINK, ::FIELD}
Returns
[]

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::loadVersionInfo (   $contentId,
  $versionNo 
)

Returns the version object for a content/version identified by $contentId and $versionNo.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf version is not found
Parameters
int | string$contentId
int$versionNoVersion number to load
Returns

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::publish (   $contentId,
  $versionNo,
MetadataUpdateStruct  $metaDataUpdateStruct 
)

Performs the publishing operations required to set the version identified by $updateStruct->versionNo and $updateStruct->id as the published one.

Parameters
int$contentId
int$versionNo
\eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct$metaDataUpdateStruct
Returns
The published Content

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::removeRelation (   $relationId,
  $type 
)

Removes a relation by relation Id.

Parameters
mixed$relationId
int$type{
See Also
::COMMON, ::EMBED, ::LINK, ::FIELD}
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif relation to be removed is not found.

Implements eZ\Publish\SPI\Persistence\Content\Handler.

eZ\Publish\Core\Persistence\InMemory\ContentHandler::setStatus (   $contentId,
  $status,
  $version 
)
eZ\Publish\Core\Persistence\InMemory\ContentHandler::trash (   $contentId)
See Also
eZ\Publish\Core\Persistence\InMemory\ContentHandler::untrash (   $contentId)
See Also
eZ\Publish\Core\Persistence\InMemory\ContentHandler::updateMetadata (   $contentId,
MetadataUpdateStruct  $content 
)

Member Data Documentation

eZ\Publish\Core\Persistence\InMemory\ContentHandler::$backend
protected
eZ\Publish\Core\Persistence\InMemory\ContentHandler::$fieldTypeRegistry
protected
eZ\Publish\Core\Persistence\InMemory\ContentHandler::$handler
protected

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