Bonjour,
$entreprise = array(1,3,4,5);
$qb = $this->createQueryBuilder('a')
->whereIn('a.entreprise', $entreprise)
->andWhere('a.profil = :profil')
->setParameter('profil', 'part');
Fatal error: Call to undefined method Doctrine\ORM\QueryBuilder::whereIn()
Si je fait:
$qb = $this->createQueryBuilder('a')
->where($qb->expr()->in('a.entreprise', $entreprise))
->andWhere('a.profil = :profil')
->setParameter('profil', 'part');
Call to a member function expr() on a non-object
Où l'erreur? A-t-il autre moyen construire la requête avec IN.
Partager