This is in controller
$candidats = $repository->findList(
$data["recherche_candidat"]["diplomes"],
$data["recherche_candidat"]["categories"]);
And this in the repository
public function findList($diplomes,$categories,)
{
$qb=$this->createQueryBuilder('c');
if($categories!=null){
$qb->andWhere('c.categorie IN (:value)')
->setParameter(':value', $categories);
}
if($diplomes!=null) {
$qb->andWhere('c.diplome IN (:value)')
->setParameter(':value', $diplomes);
}
return $qb
->getQuery()
->getResult();
}
problem is when diplomes and categories not null I see an error :
Too many parameters: the query defines 1 parameters and you bound 2
With one null its work; for example diplomes==null and categories!=null it work without error