private function doGetCollectionByContent($contentType, $contentUid)
    {
        $content = null;
        $classname = AbstractClassContent::getClassnameByContentType($contentType);
        $em = $this->getApplication()->getEntityManager();

        try {
            $content = $em->find($classname, $contentUid);
        } catch (ClassNotFoundException $e) {
            throw new NotFoundHttpException("No classcontent found with provided type (:$contentType)");
        }

        if (null === $content) {
            throw new NotFoundHttpException("No `$classname` exists with uid `$contentUid`");
        }

        $pages = $em->getRepository("BackBee\ClassContent\AbstractClassContent")->findPagesByContent($content);

        $response = $this->createResponse($this->formatCollection($pages));
        if (0 < count($pages)) {
            $response->headers->set('Content-Range', '0-'.(count($pages) - 1).'/'.count($pages));
        }

        return $response;
    }
private function doGetCollectionByContent($contentType, $contentUid)
    {
        $content = null;
        $classname = AbstractClassContent::getClassnameByContentType($contentType);
        $em = $this->getApplication()->getEntityManager();

        try {
            $content = $em->find($classname, $contentUid);
        } catch (ClassNotFoundException $e) {
            throw new NotFoundHttpException("No classcontent found with provided type (:$contentType)");
        }

        if (null === $content) {
            throw new NotFoundHttpException("No `$classname` exists with uid `$contentUid`");
        }

        $pages = $em->getRepository("BackBee\ClassContent\AbstractClassContent")->findPagesByContent($content);

        $response = $this->createResponse($this->formatCollection($pages));
        if (0 < count($pages)) {
            $response->headers->set('Content-Range', '0-'.(count($pages) - 1).'/'.count($pages));
        }

        return $response;
    }
private function doGetCollectionByContent ( $ contentType , $ contentUid ) { $ content = null ; $ classname = AbstractClassContent :: getClassnameByContentType ( $ contentType ) ; $ em = $ this -> getApplication ( ) -> getEntityManager ( ) ; try { $ content = $ em -> find ( $ classname , $ contentUid ) ; } catch ( ClassNotFoundException $ e ) { throw new NotFoundHttpException ( "No classcontent found with provided type (:$contentType)" ) ; } if ( null === $ content ) { throw new NotFoundHttpException ( "No `$classname` exists with uid `$contentUid`" ) ; } $ pages = $ em -> getRepository ( "BackBee\ClassContent\AbstractClassContent" ) -> findPagesByContent ( $ content ) ; $ response = $ this -> createResponse ( $ this -> formatCollection ( $ pages ) ) ; if ( 0 < count ( $ pages ) ) { $ response -> headers -> set ( 'Content-Range' , '0-' . ( count ( $ pages ) - 1 ) . '/' . count ( $ pages ) ) ; } return $ response ; }
Returns every pages that contains provided classcontent.

@param string $contentType
@param string $contentUid

@return \Symfony\Component\HttpFoundation\Response
Returns every pages that contains provided classcontent .