public function paginate($page = 1, $itemsPerPage = 20)
    {
        $query = $this->createAndFilterQueryBuilder($this->getEntityAlias());
        $query->setFirstResult(($page - 1) * $itemsPerPage);
        $query->setMaxResults($itemsPerPage);
        return new Paginator($query);
    }
public function paginate($page = 1, $itemsPerPage = 20)
    {
        $query = $this->createAndFilterQueryBuilder($this->getEntityAlias());
        $query->setFirstResult(($page - 1) * $itemsPerPage);
        $query->setMaxResults($itemsPerPage);
        return new Paginator($query);
    }
public function paginate ( $ page = 1 , $ itemsPerPage = 20 ) { $ query = $ this -> createAndFilterQueryBuilder ( $ this -> getEntityAlias ( ) ) ; $ query -> setFirstResult ( ( $ page - 1 ) * $ itemsPerPage ) ; $ query -> setMaxResults ( $ itemsPerPage ) ; return new Paginator ( $ query ) ; }
Paginate results in current filter scope

@param integer $page
@param integer $itemsPerPage
@return Paginator
Paginate results in current filter scope