private function findContentsByCriteria(array $classnames, $start, $count)
    {
        $criterias = array_merge([
            'only_online' => false,
            'site_uid'    => $this->getApplication()->getSite()->getUid(),
        ], $this->getRequest()->query->all());

        $criterias['only_online'] = (boolean) $criterias['only_online'];
        $preserveOrder = isset($criterias['preserve_order']) ? (boolean) $criterias['preserve_order'] : false;

        $order_infos = [
            'column'    => isset($criterias['order_by']) ? $criterias['order_by'] : '_modified',
            'direction' => isset($criterias['order_direction']) ? $criterias['order_direction'] : 'desc',
        ];

        $pagination = ['start' => $start, 'limit' => $count];

        unset($criterias['order_by']);
        unset($criterias['order_direction']);

        $criterias['contentIds'] = array_filter(explode(',', $this->getRequest()->query->get('uids', '')));

        unset($criterias['uids']);
        unset($criterias['preserve_order']);

        $contents = $this->getEntityManager()
            ->getRepository('BackBee\ClassContent\AbstractClassContent')
            ->findContentsBySearch($classnames, $order_infos, $pagination, $criterias)
        ;

        if ($preserveOrder === true) {
            $contents = $this->sortByUids($criterias['contentIds'], $contents);
        }

        foreach ($contents as $content) {
            $content->setDraft($this->getClassContentManager()->getDraft($content));
        }

        return $contents;
    }
private function findContentsByCriteria(array $classnames, $start, $count)
    {
        $criterias = array_merge([
            'only_online' => false,
            'site_uid'    => $this->getApplication()->getSite()->getUid(),
        ], $this->getRequest()->query->all());

        $criterias['only_online'] = (boolean) $criterias['only_online'];
        $preserveOrder = isset($criterias['preserve_order']) ? (boolean) $criterias['preserve_order'] : false;

        $order_infos = [
            'column'    => isset($criterias['order_by']) ? $criterias['order_by'] : '_modified',
            'direction' => isset($criterias['order_direction']) ? $criterias['order_direction'] : 'desc',
        ];

        $pagination = ['start' => $start, 'limit' => $count];

        unset($criterias['order_by']);
        unset($criterias['order_direction']);

        $criterias['contentIds'] = array_filter(explode(',', $this->getRequest()->query->get('uids', '')));

        unset($criterias['uids']);
        unset($criterias['preserve_order']);

        $contents = $this->getEntityManager()
            ->getRepository('BackBee\ClassContent\AbstractClassContent')
            ->findContentsBySearch($classnames, $order_infos, $pagination, $criterias)
        ;

        if ($preserveOrder === true) {
            $contents = $this->sortByUids($criterias['contentIds'], $contents);
        }

        foreach ($contents as $content) {
            $content->setDraft($this->getClassContentManager()->getDraft($content));
        }

        return $contents;
    }
private function findContentsByCriteria ( array $ classnames , $ start , $ count ) { $ criterias = array_merge ( [ 'only_online' => false , 'site_uid' => $ this -> getApplication ( ) -> getSite ( ) -> getUid ( ) , ] , $ this -> getRequest ( ) -> query -> all ( ) ) ; $ criterias [ 'only_online' ] = ( boolean ) $ criterias [ 'only_online' ] ; $ preserveOrder = isset ( $ criterias [ 'preserve_order' ] ) ? ( boolean ) $ criterias [ 'preserve_order' ] : false ; $ order_infos = [ 'column' => isset ( $ criterias [ 'order_by' ] ) ? $ criterias [ 'order_by' ] : '_modified' , 'direction' => isset ( $ criterias [ 'order_direction' ] ) ? $ criterias [ 'order_direction' ] : 'desc' , ] ; $ pagination = [ 'start' => $ start , 'limit' => $ count ] ; unset ( $ criterias [ 'order_by' ] ) ; unset ( $ criterias [ 'order_direction' ] ) ; $ criterias [ 'contentIds' ] = array_filter ( explode ( ',' , $ this -> getRequest ( ) -> query -> get ( 'uids' , '' ) ) ) ; unset ( $ criterias [ 'uids' ] ) ; unset ( $ criterias [ 'preserve_order' ] ) ; $ contents = $ this -> getEntityManager ( ) -> getRepository ( 'BackBee\ClassContent\AbstractClassContent' ) -> findContentsBySearch ( $ classnames , $ order_infos , $ pagination , $ criterias ) ; if ( $ preserveOrder === true ) { $ contents = $ this -> sortByUids ( $ criterias [ 'contentIds' ] , $ contents ) ; } foreach ( $ contents as $ content ) { $ content -> setDraft ( $ this -> getClassContentManager ( ) -> getDraft ( $ content ) ) ; } return $ contents ; }
Find classcontents by provided classnames, criterias from request, provided start and count.

@param array   $classnames
@param integer $start
@param integer $count

@return null|Paginator
Find classcontents by provided classnames criterias from request provided start and count .