public function loadReverseRelations(ContentInfo $contentInfo)
    {
        if (!$this->repository->canUser('content', 'reverserelatedlist', $contentInfo)) {
            throw new UnauthorizedException('content', 'reverserelatedlist', array('contentId' => $contentInfo->id));
        }

        $spiRelations = $this->persistenceHandler->contentHandler()->loadReverseRelations(
            $contentInfo->id
        );

        $returnArray = array();
        foreach ($spiRelations as $spiRelation) {
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
                continue;
            }

            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
                $spiRelation,
                $sourceContentInfo,
                $contentInfo
            );
        }

        return $returnArray;
    }
public function loadReverseRelations(ContentInfo $contentInfo)
    {
        if (!$this->repository->canUser('content', 'reverserelatedlist', $contentInfo)) {
            throw new UnauthorizedException('content', 'reverserelatedlist', array('contentId' => $contentInfo->id));
        }

        $spiRelations = $this->persistenceHandler->contentHandler()->loadReverseRelations(
            $contentInfo->id
        );

        $returnArray = array();
        foreach ($spiRelations as $spiRelation) {
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
                continue;
            }

            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
                $spiRelation,
                $sourceContentInfo,
                $contentInfo
            );
        }

        return $returnArray;
    }
public function loadReverseRelations ( ContentInfo $ contentInfo ) { if ( ! $ this -> repository -> canUser ( 'content' , 'reverserelatedlist' , $ contentInfo ) ) { throw new UnauthorizedException ( 'content' , 'reverserelatedlist' , array ( 'contentId' => $ contentInfo -> id ) ) ; } $ spiRelations = $ this -> persistenceHandler -> contentHandler ( ) -> loadReverseRelations ( $ contentInfo -> id ) ; $ returnArray = array ( ) ; foreach ( $ spiRelations as $ spiRelation ) { $ sourceContentInfo = $ this -> internalLoadContentInfo ( $ spiRelation -> sourceContentId ) ; if ( ! $ this -> repository -> canUser ( 'content' , 'read' , $ sourceContentInfo ) ) { continue ; } $ returnArray [ ] = $ this -> domainMapper -> buildRelationDomainObject ( $ spiRelation , $ sourceContentInfo , $ contentInfo ) ; } return $ returnArray ; }
Loads all incoming relations for a content object.

The relations come only from published versions of the source content objects

@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to read this version

@param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo

@return \eZ\Publish\API\Repository\Values\Content\Relation[]
Loads all incoming relations for a content object .