public function getCollectionByContentAction($type, $uid, $start, $count)
    {
        $content = $this->findOneByTypeAndUid($type, $uid);
        $this->granted('VIEW', $content);

        $revisions = $this->getEntityManager()
                ->getRepository('BackBee\ClassContent\Revision')
                ->getRevisions($content, [Revision::STATE_COMMITTED], $start, $count);

        $result = [];
        foreach ($revisions as $revision) {
            $result[] = $revision->jsonSerialize(Revision::JSON_REVISION_FORMAT);
        }

        $response = $this->createJsonResponse();
        $response->setData($result);

        if ($revisions instanceof Paginator) {
            $response->headers->set('Content-Range', sprintf('%d-%d/%d', $start, $start +
                            count($result) - 1, count($revisions)));
        }

        return $response;
    }
public function getCollectionByContentAction($type, $uid, $start, $count)
    {
        $content = $this->findOneByTypeAndUid($type, $uid);
        $this->granted('VIEW', $content);

        $revisions = $this->getEntityManager()
                ->getRepository('BackBee\ClassContent\Revision')
                ->getRevisions($content, [Revision::STATE_COMMITTED], $start, $count);

        $result = [];
        foreach ($revisions as $revision) {
            $result[] = $revision->jsonSerialize(Revision::JSON_REVISION_FORMAT);
        }

        $response = $this->createJsonResponse();
        $response->setData($result);

        if ($revisions instanceof Paginator) {
            $response->headers->set('Content-Range', sprintf('%d-%d/%d', $start, $start +
                            count($result) - 1, count($revisions)));
        }

        return $response;
    }
public function getCollectionByContentAction ( $ type , $ uid , $ start , $ count ) { $ content = $ this -> findOneByTypeAndUid ( $ type , $ uid ) ; $ this -> granted ( 'VIEW' , $ content ) ; $ revisions = $ this -> getEntityManager ( ) -> getRepository ( 'BackBee\ClassContent\Revision' ) -> getRevisions ( $ content , [ Revision :: STATE_COMMITTED ] , $ start , $ count ) ; $ result = [ ] ; foreach ( $ revisions as $ revision ) { $ result [ ] = $ revision -> jsonSerialize ( Revision :: JSON_REVISION_FORMAT ) ; } $ response = $ this -> createJsonResponse ( ) ; $ response -> setData ( $ result ) ; if ( $ revisions instanceof Paginator ) { $ response -> headers -> set ( 'Content-Range' , sprintf ( '%d-%d/%d' , $ start , $ start + count ( $ result ) - 1 , count ( $ revisions ) ) ) ; } return $ response ; }
Returns collection of revisions for a content.

@return Symfony\Component\HttpFoundation\JsonResponse

@Rest\Pagination(default_count=25, max_count=100)
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')")
Returns collection of revisions for a content .