Class

eZ\Publish\Core\Repository\Helper\RelationProcessor

class RelationProcessor

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

Methods

__construct(Handler $handler)

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

appendFieldRelations(array $relations, array $locationIdToContentIdMapping, FieldType $fieldType, Value $fieldValue, string $fieldDefinitionId)

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

processFieldRelations(array $inputRelations, mixed $sourceContentId, mixed $sourceContentVersionNo, ContentType $contentType, array $existingRelations = array())

Persists relation data for a content version.

Details

at line 35
public __construct(Handler $handler)

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

Parameters

Handler $handler

at line 51
public appendFieldRelations(array $relations, array $locationIdToContentIdMapping, FieldType $fieldType, Value $fieldValue, string $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 $locationIdToContentIdMapping An array with Location Ids as keys and corresponding Content Id as values
FieldType $fieldType
Value $fieldValue Accepted field value.
string $fieldDefinitionId

at line 100
public processFieldRelations(array $inputRelations, mixed $sourceContentId, mixed $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
ContentType $contentType
array $existingRelations An array of existing relations for Content version (empty when creating new content)