Doctrine DQL does not support connection in the update.
Try the following:
$qb = $this->getEntityManager()->createQueryBuilder(); $qb ->update('MyBundle:Entity1', 'e1') ->set('e1.visibile', '1') ->where('e1.Entity2 = :id') ->setParameter("id", 123) ;
You can set the id if it is the primary key of the associated object directly, as if it were an object, Doctrine will display it.
I do the same in my queries and it works.
source share