eZPublishCommunityProject  2013.4
eZ\Publish\SPI\Persistence\Content\Handler Interface Reference

The Content Handler interface defines content operations on the storage engine. More...

+ Inheritance diagram for eZ\Publish\SPI\Persistence\Content\Handler:

Public Member Functions

 addRelation (RelationCreateStruct $createStruct)
 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...
 
 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...
 
 deleteContent ($contentId)
 Deletes all versions and fields, all locations (subtree), and all relations. More...
 
 deleteVersion ($contentId, $versionNo)
 Deletes given version, its fields, node assignment, relations and names. More...
 
 listVersions ($contentId)
 Returns the versions for $contentId. More...
 
 load ($id, $version, $translations=null)
 Returns the raw data of a content object identified by $id, in a struct. More...
 
 loadContentInfo ($contentId)
 Returns the metadata object for a content identified by $contentId. More...
 
 loadDraftsForUser ($userId)
 Returns all versions with draft status created by the given $userId. More...
 
 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)
 Sets the status of object identified by $contentId and $version to $status. More...
 
 updateContent ($contentId, $versionNo, UpdateStruct $content)
 Updates a content version, identified by $contentId and $versionNo. More...
 
 updateMetadata ($contentId, MetadataUpdateStruct $content)
 Updates a content object meta data, identified by $contentId. More...
 

Detailed Description

The Content Handler interface defines content operations on the storage engine.

The basic operations which are performed on content objects are collected in this interface. Typically this interface would be used by a service managing business logic for content objects.

Member Function Documentation

eZ\Publish\SPI\Persistence\Content\Handler::addRelation ( RelationCreateStruct  $createStruct)

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

Todo:
Should the existence verifications happen here or is this supposed to be handled at a higher level?
Parameters
\eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct$createStruct
Returns

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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
Returns

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Handler, eZ\Publish\Core\Persistence\InMemory\ContentHandler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::create ( CreateStruct  $content)

Creates a new Content entity in the storage engine.

The values contained inside the $content will form the basis of stored entity.

Will contain always a complete list of fields.

Parameters
\eZ\Publish\SPI\Persistence\Content\CreateStruct$contentContent creation struct.
Returns
Content value object

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::createDraftFromVersion (   $contentId,
  $srcVersion,
  $userId 
)

Creates a new draft version from $contentId in $srcVersion number.

Copies all fields from $contentId in $srcVersion and creates a new version of the referred Content from it.

Parameters
mixed$contentId
mixed$srcVersion
mixed$userId
Returns

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::deleteContent (   $contentId)

Deletes all versions and fields, all locations (subtree), and all relations.

Removes the relations, but not the related objects. All subtrees of the assigned nodes of this content objects are removed (recursively).

Parameters
int$contentId
Returns
boolean

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::listVersions (   $contentId)
eZ\Publish\SPI\Persistence\Content\Handler::load (   $id,
  $version,
  $translations = null 
)

Returns the raw data of a content object identified by $id, in a struct.

A version to load must be specified. If you want to load the current version of a content object use SearchHandler::findSingle() with the ContentId criterion.

Optionally a translation filter may be specified. If specified only the translations with the listed language codes will be retrieved. If not, all translations will be retrieved.

Parameters
int | string$id
int | string$version
string[]$translations
Returns
Content value object

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::loadContentInfo (   $contentId)

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

Parameters
int | string$contentId
Returns

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::loadDraftsForUser (   $userId)

Returns all versions with draft status created by the given $userId.

Parameters
int$userId
Returns
[]

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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
[]

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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
[]

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::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

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Cache\ContentHandler, and eZ\Publish\Core\Persistence\Legacy\Content\Handler.

eZ\Publish\SPI\Persistence\Content\Handler::removeRelation (   $relationId,
  $type 
)

Removes a relation by relation Id.

Todo:
Should the existence verifications happen here or is this supposed to be handled at a higher level?
Parameters
mixed$relationId
int$type{
See Also
::COMMON, ::EMBED, ::LINK, ::FIELD}
Returns
void

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::setStatus (   $contentId,
  $status,
  $version 
)

Sets the status of object identified by $contentId and $version to $status.

The $status can be one of VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED When status is set to VersionInfo::STATUS_PUBLISHED content status is updated to ContentInfo::STATUS_PUBLISHED

Parameters
int$contentId
int$status
int$version
Returns
boolean

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.

eZ\Publish\SPI\Persistence\Content\Handler::updateContent (   $contentId,
  $versionNo,
UpdateStruct  $content 
)

Updates a content version, identified by $contentId and $versionNo.

Parameters
int$contentId
int$versionNo
\eZ\Publish\SPI\Persistence\Content\UpdateStruct$content
Returns
eZ\Publish\SPI\Persistence\Content\Handler::updateMetadata (   $contentId,
MetadataUpdateStruct  $content 
)

Updates a content object meta data, identified by $contentId.

Parameters
int$contentId
\eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct$content
Returns

Implemented in eZ\Publish\Core\Persistence\InMemory\ContentHandler, eZ\Publish\Core\Persistence\Legacy\Content\Handler, and eZ\Publish\Core\Persistence\Cache\ContentHandler.


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