eZPublishCommunityProject  2013.4
eZ\Publish\Core\Repository\RelationProcessor Class Reference

RelationProcessor is an internal service used for handling field relations upon Content creation or update. More...

Public Member Functions

 __construct (RepositoryInterface $repository, Handler $handler)
 Setups service with reference to repository object that created it & corresponding handler. More...
 
 appendFieldRelations (array &$relations, array &$locationIdToContentIdMapping, SPIFieldType $fieldType, BaseValue $fieldValue, $fieldDefinitionId)
 Appends destination Content ids of given $fieldValue to the $relation array. More...
 
 getFieldRelations (ContentInfo $contentInfo)
 Returns field relations data for the current version of the given $contentInfo. More...
 
 processFieldRelations (array $inputRelations, $sourceContentId, $sourceContentVersionNo, ContentType $contentType, array $existingRelations=array())
 Persists relation data for a content version. More...
 

Protected Attributes

 $persistenceHandler
 
 $repository
 

Detailed Description

RelationProcessor is an internal service used for handling field relations upon Content creation or update.

Constructor & Destructor Documentation

eZ\Publish\Core\Repository\RelationProcessor::__construct ( RepositoryInterface  $repository,
Handler  $handler 
)

Setups service with reference to repository object that created it & corresponding handler.

Parameters
\eZ\Publish\API\Repository\Repository$repository
\eZ\Publish\SPI\Persistence\Handler$handler

Member Function Documentation

eZ\Publish\Core\Repository\RelationProcessor::appendFieldRelations ( array &  $relations,
array &  $locationIdToContentIdMapping,
SPIFieldType  $fieldType,
BaseValue  $fieldValue,
  $fieldDefinitionId 
)

Appends destination Content ids of given $fieldValue to the $relation array.

If $fieldValue contains Location ids, the will be converted to the Content id that Location encapsulates.

Parameters
array$relations
array$locationIdToContentIdMappingAn array with Location Ids as keys and corresponding Content Id as values
\eZ\Publish\SPI\FieldType\FieldType$fieldType
\eZ\Publish\Core\FieldType\Value$fieldValueAccepted field value.
string$fieldDefinitionId
Returns
void

Referenced by eZ\Publish\Core\Repository\RelationProcessor\getFieldRelations().

eZ\Publish\Core\Repository\RelationProcessor::getFieldRelations ( ContentInfo  $contentInfo)

Returns field relations data for the current version of the given $contentInfo.

Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
Returns
mixed
eZ\Publish\Core\Repository\RelationProcessor::processFieldRelations ( array  $inputRelations,
  $sourceContentId,
  $sourceContentVersionNo,
ContentType  $contentType,
array  $existingRelations = array() 
)

Persists relation data for a content version.

This method creates new relations and deletes removed relations.

Parameters
array$inputRelations
mixed$sourceContentId
mixed$sourceContentVersionNo
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
\eZ\Publish\API\Repository\Values\Content\Relation[]$existingRelations An array of existing relations for Content version (empty when creating new content)
Returns
void

Member Data Documentation

eZ\Publish\Core\Repository\RelationProcessor::$persistenceHandler
protected
eZ\Publish\Core\Repository\RelationProcessor::$repository
protected

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