Your issue is probably because of misuse of the setParameters()
mehtod. There is two simmilar methods for the doctrine query builder:
1) setParameter()
which sets only one parameter per method usage. The syntax is:
// for numeric parameters
$qb->leftjoin('c.translations', 'ct', 'WITH', 'ct.locale = ?1')
->setParameter(1, 'fr');
// for string parameters
$qb->leftjoin('c.translations', 'ct', 'WITH', 'ct.locale = :locale')
->setParameter('locale', 'fr');
2) setParameters()
which sets multiple parameters:
// String params
$qb->where('u.id = :uid')
->leftjoin('c.translations', 'ct', 'WITH', 'ct.locale = :locale')
->setParameters(array('locale' => 'fr', 'uid' => $userId));
// Numeric parameters are also available here
$qb->where('u.id = ?1')
->leftjoin('c.translations', 'ct', 'WITH', 'ct.locale = ?2')
->setParameters(array(2 => 'fr', 1 => $userId));
So you probably wanted to use setParameter()
instead of setParameters()
in your query builder.