Switched to use a query parameter in the ORM implementation

This commit is contained in:
Christophe Coevoet 2011-06-18 14:56:18 +02:00
parent b6c4a582d3
commit 84c98d5b70
2 changed files with 3 additions and 5 deletions

View file

@ -31,7 +31,9 @@ class ElasticaToModelTransformer extends AbstractElasticaToModelTransformer
$qb = $this->objectManager
->getRepository($class)
->createQueryBuilder('o');
$qb->where($qb->expr()->in('o.'.$identifierField, $identifierValues));
/* @var $qb \Doctrine\ORM\QueryBuilder */
$qb->where($qb->expr()->in('o.'.$identifierField, ':values'))
->setParameter('values', $identifierValues, 'array');
return $qb->getQuery()->setHydrationMode($hydrationMode)->execute();
}

View file

@ -9,10 +9,6 @@ class Provider extends AbstractProvider
/**
* Counts the objects of a query builder
*
* OMG this implementation is radical. Yes. There seems to be
* no easy way to do that with Doctrine ORM 2.0.
* Please tell me if you have a better idea.
*
* @param queryBuilder
* @return int
**/