public function buildRelationDomainObject(
        SPIRelation $spiRelation,
        ContentInfo $sourceContentInfo,
        ContentInfo $destinationContentInfo
    ) {
        $sourceFieldDefinitionIdentifier = null;
        if ($spiRelation->sourceFieldDefinitionId !== null) {
            $contentType = $this->contentTypeHandler->load($sourceContentInfo->contentTypeId);
            foreach ($contentType->fieldDefinitions as $fieldDefinition) {
                if ($fieldDefinition->id !== $spiRelation->sourceFieldDefinitionId) {
                    continue;
                }

                $sourceFieldDefinitionIdentifier = $fieldDefinition->identifier;
                break;
            }
        }

        return new Relation(
            array(
                'id' => $spiRelation->id,
                'sourceFieldDefinitionIdentifier' => $sourceFieldDefinitionIdentifier,
                'type' => $spiRelation->type,
                'sourceContentInfo' => $sourceContentInfo,
                'destinationContentInfo' => $destinationContentInfo,
            )
        );
    }
public function buildRelationDomainObject(
        SPIRelation $spiRelation,
        ContentInfo $sourceContentInfo,
        ContentInfo $destinationContentInfo
    ) {
        $sourceFieldDefinitionIdentifier = null;
        if ($spiRelation->sourceFieldDefinitionId !== null) {
            $contentType = $this->contentTypeHandler->load($sourceContentInfo->contentTypeId);
            foreach ($contentType->fieldDefinitions as $fieldDefinition) {
                if ($fieldDefinition->id !== $spiRelation->sourceFieldDefinitionId) {
                    continue;
                }

                $sourceFieldDefinitionIdentifier = $fieldDefinition->identifier;
                break;
            }
        }

        return new Relation(
            array(
                'id' => $spiRelation->id,
                'sourceFieldDefinitionIdentifier' => $sourceFieldDefinitionIdentifier,
                'type' => $spiRelation->type,
                'sourceContentInfo' => $sourceContentInfo,
                'destinationContentInfo' => $destinationContentInfo,
            )
        );
    }
public function buildRelationDomainObject ( SPIRelation $ spiRelation , ContentInfo $ sourceContentInfo , ContentInfo $ destinationContentInfo ) { $ sourceFieldDefinitionIdentifier = null ; if ( $ spiRelation -> sourceFieldDefinitionId !== null ) { $ contentType = $ this -> contentTypeHandler -> load ( $ sourceContentInfo -> contentTypeId ) ; foreach ( $ contentType -> fieldDefinitions as $ fieldDefinition ) { if ( $ fieldDefinition -> id !== $ spiRelation -> sourceFieldDefinitionId ) { continue ; } $ sourceFieldDefinitionIdentifier = $ fieldDefinition -> identifier ; break ; } } return new Relation ( array ( 'id' => $ spiRelation -> id , 'sourceFieldDefinitionIdentifier' => $ sourceFieldDefinitionIdentifier , 'type' => $ spiRelation -> type , 'sourceContentInfo' => $ sourceContentInfo , 'destinationContentInfo' => $ destinationContentInfo , ) ) ; }
Builds API Relation object from provided SPI Relation object.

@param \eZ\Publish\SPI\Persistence\Content\Relation $spiRelation
@param \eZ\Publish\API\Repository\Values\Content\ContentInfo $sourceContentInfo
@param \eZ\Publish\API\Repository\Values\Content\ContentInfo $destinationContentInfo

@return \eZ\Publish\API\Repository\Values\Content\Relation
Builds API Relation object from provided SPI Relation object .