I try to bind parameter : [1, 2] in dbal querybuilder in WHERE IN statement
I tried to change $qb->expr()->in()
to string version but nothing changed
QueryBuilder creation
$qb = $this->_em->getConnection()->createQueryBuilder()
->select('c.id AS id')
->from('category', 'c')
->andWhere($qb->expr()->in('c.id', ':categories'))->setParameter('categories', [1, 2], \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);
Execution:
$qb->execute()->fetchAll();
Error : Array to string conversion
Expects to bind array of integers to querybuilder statement