public function getRootCategoriesPager($page = 1, $limit = 25, $criteria = [])
    {
        $page = 0 === (int) $page ? 1 : (int) $page;

        $queryBuilder = $this->getObjectManager()->createQueryBuilder()
            ->select('c')
            ->from($this->class, 'c')
            ->andWhere('c.parent IS NULL');

        $pager = new Pager($limit);
        $pager->setQuery(new ProxyQuery($queryBuilder));
        $pager->setPage($page);
        $pager->init();

        return $pager;
    }
public function getRootCategoriesPager($page = 1, $limit = 25, $criteria = [])
    {
        $page = 0 === (int) $page ? 1 : (int) $page;

        $queryBuilder = $this->getObjectManager()->createQueryBuilder()
            ->select('c')
            ->from($this->class, 'c')
            ->andWhere('c.parent IS NULL');

        $pager = new Pager($limit);
        $pager->setQuery(new ProxyQuery($queryBuilder));
        $pager->setPage($page);
        $pager->init();

        return $pager;
    }
public function getRootCategoriesPager ( $ page = 1 , $ limit = 25 , $ criteria = [ ] ) { $ page = 0 === ( int ) $ page ? 1 : ( int ) $ page ; $ queryBuilder = $ this -> getObjectManager ( ) -> createQueryBuilder ( ) -> select ( 'c' ) -> from ( $ this -> class , 'c' ) -> andWhere ( 'c.parent IS NULL' ) ; $ pager = new Pager ( $ limit ) ; $ pager -> setQuery ( new ProxyQuery ( $ queryBuilder ) ) ; $ pager -> setPage ( $ page ) ; $ pager -> init ( ) ; return $ pager ; }
Returns a pager to iterate over the root category.

@param int   $page
@param int   $limit
@param array $criteria

@return mixed
Returns a pager to iterate over the root category .