PHP Class eZ\Publish\Core\Repository\Helper\RelationProcessor

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$persistenceHandler eZ\Publish\SPI\Persistence\Handler

Public Methods

Method Description
__construct ( eZ\Publish\SPI\Persistence\Handler $handler ) Setups service with reference to repository object that created it & corresponding handler.
appendFieldRelations ( array &$relations, array &$locationIdToContentIdMapping, eZ\Publish\SPI\FieldType\FieldType $fieldType, Value $fieldValue, string $fieldDefinitionId ) Appends destination Content ids of given $fieldValue to the $relation array.
processFieldRelations ( array $inputRelations, mixed $sourceContentId, mixed $sourceContentVersionNo, eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $existingRelations = [] ) Persists relation data for a content version.

Method Details

__construct() public method

Setups service with reference to repository object that created it & corresponding handler.
public __construct ( eZ\Publish\SPI\Persistence\Handler $handler )
$handler eZ\Publish\SPI\Persistence\Handler

appendFieldRelations() public method

If $fieldValue contains Location ids, the will be converted to the Content id that Location encapsulates.
public appendFieldRelations ( array &$relations, array &$locationIdToContentIdMapping, eZ\Publish\SPI\FieldType\FieldType $fieldType, Value $fieldValue, string $fieldDefinitionId )
$relations array
$locationIdToContentIdMapping array An array with Location Ids as keys and corresponding Content Id as values
$fieldType eZ\Publish\SPI\FieldType\FieldType
$fieldValue eZ\Publish\Core\FieldType\Value Accepted field value.
$fieldDefinitionId string

processFieldRelations() public method

This method creates new relations and deletes removed relations.
public processFieldRelations ( array $inputRelations, mixed $sourceContentId, mixed $sourceContentVersionNo, eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType, array $existingRelations = [] )
$inputRelations array
$sourceContentId mixed
$sourceContentVersionNo mixed
$contentType eZ\Publish\API\Repository\Values\ContentType\ContentType
$existingRelations array An array of existing relations for Content version (empty when creating new content)

Property Details

$persistenceHandler protected property

protected Handler,eZ\Publish\SPI\Persistence $persistenceHandler
return eZ\Publish\SPI\Persistence\Handler