public applyPaging ( integer $offset, integer $limit ) : |
||
$offset | integer | |
$limit | integer | |
Результат |
/** * @param array $criteria * @param array $orderBy * @param null $limit * @param null $offset * @return \ArrayIterator */ public function findForApi(array $criteria, array $orderBy = null, $limit = null, $offset = null) { $query = $this->dao->createQueryBuilder('p')->whereCriteria($criteria)->autoJoinOrderBy((array) $orderBy)->leftJoin('p.tags', 'tt')->addSelect('tt')->getQuery(); $resultSet = new Kdyby\Doctrine\ResultSet($query); return $resultSet->applyPaging($offset, $limit)->getIterator(Doctrine\ORM\AbstractQuery::HYDRATE_ARRAY); }
/** * @return \ArrayIterator */ public function findBy(array $criteria, array $orderBy = NULL, $limit = NULL, $offset = NULL) { $query = $this->dao->createQueryBuilder('p')->whereCriteria($criteria)->autoJoinOrderBy((array) $orderBy)->leftJoin('p.tags', 'tt')->addSelect('tt')->getQuery(); $resultSet = new Kdyby\Doctrine\ResultSet($query); return $resultSet->applyPaging($offset, $limit)->getIterator(); }