KnpLabs/knp-components — pull request #79 by stephpy (2013-07-25 11:45:26+00:00)
Title: Fix “number of bound variables does not match number of tokens“, for doctrine 2.3.0

Scenario:

10 results are available in 1 page.

Asking for page 1 => OK
Asking for page 2 =>

```php
$whereInQuery
->setHint($useDoctrineWalkers ?
DoctrineWhereInWalker::HINT_PAGINATOR_ID_COUNT :
WhereInWalker::HINT_PAGINATOR_ID_COUNT, count($ids)
)
->setFirstResult(null)
->setMaxResults(null)
;
```

Will not add IN (:dpid) to the query BUT

```php
if (version_compare(\Doctrine\ORM\Version::VERSION, '2.3.0', '>=')) {
$whereInQuery->setParameter(WhereInWalker::PAGINATOR_ID_ALIAS, $ids);
```

will ...

By this way, we have to add the parameter ONLY if there is ids fetched.