Skip to content

Commit

Permalink
Bug corrected on count
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Nov 21, 2011
1 parent 0a9b043 commit cd0dda7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SpiffyDoctrine/Paginator/Adapter/DqlQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(array $options)
$this->query = $options['query'];
}
elseif ($options['query'] instanceof QueryBuilder) {
$this->query = $options['query']->getDQL();
$this->query = $options['query']->getQuery();
}
else {
throw new Exception\InvalidArgumentException('Query must either be a DQL string, a Query object or a QueryBuilder object.');
Expand All @@ -92,7 +92,7 @@ public function __construct(array $options)
*/
public function getItems($offset, $itemCountPerPage)
{
$this->query->setFirstResult(($offset - 1) * $itemCountPerPage)
$this->query->setFirstResult($offset)
->setMaxResults($itemCountPerPage);

return $this->query->getResult();
Expand Down

0 comments on commit cd0dda7

Please sign in to comment.