13
如何在教义2中使用WHERE IN
我有以下代码给我错误: Message: Invalid parameter number: number of bound variables does not match number of tokens 码: public function getCount($ids, $outcome) { if (!is_array($ids)) { $ids = array($ids); } $qb = $this->getEntityManager()->createQueryBuilder(); $qb->add('select', $qb->expr()->count('r.id')) ->add('from', '\My\Entity\Rating r'); if ($outcome === 'wins') { $qb->add('where', $qb->expr()->in('r.winner', array('?1'))); } if ($outcome === 'fails') { …