public function paginate($limit = 25, $page = 0)
    {
        if ($limit > 0) {
            $this->queryBuilder->setMaxResults($limit);
        }

        if ($page > 0) {
            $this->queryBuilder->setFirstResult($page * $limit);
        }

        return $this;
    }
public function paginate($limit = 25, $page = 0)
    {
        if ($limit > 0) {
            $this->queryBuilder->setMaxResults($limit);
        }

        if ($page > 0) {
            $this->queryBuilder->setFirstResult($page * $limit);
        }

        return $this;
    }
public function paginate ( $ limit = 25 , $ page = 0 ) { if ( $ limit > 0 ) { $ this -> queryBuilder -> setMaxResults ( $ limit ) ; } if ( $ page > 0 ) { $ this -> queryBuilder -> setFirstResult ( $ page * $ limit ) ; } return $ this ; }
Set the page with paginate attribute.

@param int $page
@param int $limit

@return $this
Set the page with paginate attribute .