Skip to content

Commit

Permalink
Merge pull request #104 from pborreli/patch-4
Browse files Browse the repository at this point in the history
Using db.XX.count in pager to count results
  • Loading branch information
dunglas committed Dec 25, 2013
2 parents b8f16fb + 24022d4 commit 0625d6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Datagrid/Pager.php
Expand Up @@ -36,8 +36,7 @@ public function computeNbResult()
$countQuery->setParameters($this->getParameters());
}

// TODO: use map/reduce for that
return $this->getQuery()->execute()->count();
return $countQuery->count()->getQuery()->execute();
}

/**
Expand Down

0 comments on commit 0625d6d

Please sign in to comment.