Skip to content

Commit

Permalink
Merge pull request #149 from stof/typehint_query_builder
Browse files Browse the repository at this point in the history
Improved the code of the DBAL adapters
  • Loading branch information
pablodip committed Oct 5, 2014
2 parents ced9404 + cc2d8fd commit bb07a14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Pagerfanta/Adapter/DoctrineDbalAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public function __construct(QueryBuilder $queryBuilder, $countQueryBuilderModifi
*/
public function getNbResults()
{
$qb = $this->prepageCountQueryBuilder();
$qb = $this->prepareCountQueryBuilder();
$result = $qb->execute()->fetchColumn();

return (int) $result;
}

private function prepageCountQueryBuilder()
private function prepareCountQueryBuilder()
{
$qb = clone $this->queryBuilder;
call_user_func($this->countQueryBuilderModifier, $qb);
Expand Down
2 changes: 1 addition & 1 deletion src/Pagerfanta/Adapter/DoctrineDbalSingleTableAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private function createCountQueryModifier($countField)
{
$select = $this->createSelectForCountField($countField);

return function ($queryBuilder) use ($select) {
return function (QueryBuilder $queryBuilder) use ($select) {
$queryBuilder->select($select)
->setMaxResults(1);
};
Expand Down

0 comments on commit bb07a14

Please sign in to comment.