Skip to content

Commit

Permalink
Merge pull request #279 from printify/master
Browse files Browse the repository at this point in the history
Fixed: Attempted to call an undefined method named "count" of class " Doctrine\ODM\MongoDB\Query\Query". in DoctrineODMMongoDBAdapter
  • Loading branch information
sampart authored Jul 17, 2019
2 parents c385484 + c5e26cc commit a53ff01
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Pagerfanta/Adapter/DoctrineODMMongoDBAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ public function getQueryBuilder()
*/
public function getNbResults()
{
return $this->queryBuilder->getQuery()->count();
$qb = clone $this->queryBuilder;

return $qb
->limit(0)
->skip(0)
->count()
->getQuery()
->execute();
}

/**
Expand Down

0 comments on commit a53ff01

Please sign in to comment.