Skip to content

Commit

Permalink
changed: allow a QueryBuilder for the Doctrine ORM Adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Brochet authored and acasademont committed Sep 26, 2011
1 parent 596edc4 commit 64094bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Pagerfanta/Adapter/DoctrineORMAdapter.php
Expand Up @@ -35,13 +35,17 @@ class DoctrineORMAdapter implements AdapterInterface
/**
* Constructor.
*
* @param Query $query A Doctrine ORM query or query builder.
* @param Boolean $fetchJoinCollection Whether the query joins a collection (false by default).
* @param Query|QueryBuilder $query A Doctrine ORM query or query builder.
* @param Boolean $fetchJoinCollection Whether the query joins a collection (false by default).
*
* @api
*/
public function __construct($query, $fetchJoinCollection = false)
{
if ($query instanceof QueryBuilder) {
$query = $query->getQuery();
}

$this->query = $query;
$this->fetchJoinCollection = (Boolean) $fetchJoinCollection;
}
Expand Down

0 comments on commit 64094bd

Please sign in to comment.