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

        $spiVersionInfoList = $this->persistenceHandler->contentHandler()->listVersions($contentInfo->id);

        $versions = array();
        foreach ($spiVersionInfoList as $spiVersionInfo) {
            $versionInfo = $this->domainMapper->buildVersionInfoDomainObject($spiVersionInfo);
            if (!$this->repository->canUser('content', 'versionread', $versionInfo)) {
                throw new UnauthorizedException('content', 'versionread', array('versionId' => $versionInfo->id));
            }

            $versions[] = $versionInfo;
        }

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

        $spiVersionInfoList = $this->persistenceHandler->contentHandler()->listVersions($contentInfo->id);

        $versions = array();
        foreach ($spiVersionInfoList as $spiVersionInfo) {
            $versionInfo = $this->domainMapper->buildVersionInfoDomainObject($spiVersionInfo);
            if (!$this->repository->canUser('content', 'versionread', $versionInfo)) {
                throw new UnauthorizedException('content', 'versionread', array('versionId' => $versionInfo->id));
            }

            $versions[] = $versionInfo;
        }

        return $versions;
    }
public function loadVersions ( ContentInfo $ contentInfo ) { if ( ! $ this -> repository -> canUser ( 'content' , 'versionread' , $ contentInfo ) ) { throw new UnauthorizedException ( 'content' , 'versionread' , array ( 'contentId' => $ contentInfo -> id ) ) ; } $ spiVersionInfoList = $ this -> persistenceHandler -> contentHandler ( ) -> listVersions ( $ contentInfo -> id ) ; $ versions = array ( ) ; foreach ( $ spiVersionInfoList as $ spiVersionInfo ) { $ versionInfo = $ this -> domainMapper -> buildVersionInfoDomainObject ( $ spiVersionInfo ) ; if ( ! $ this -> repository -> canUser ( 'content' , 'versionread' , $ versionInfo ) ) { throw new UnauthorizedException ( 'content' , 'versionread' , array ( 'versionId' => $ versionInfo -> id ) ) ; } $ versions [ ] = $ versionInfo ; } return $ versions ; }
Loads all versions for the given content.

@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to list versions

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

@return \eZ\Publish\API\Repository\Values\Content\VersionInfo[] Sorted by creation date
Loads all versions for the given content .