symfony - HOW MAKE A update WITH left join DOCTRINE -


i want in doctrine symonfy2

 update producto p  left join producto_compra pc on p.id = pc.id_producto  set p.cantidad = (p.cantidad - pc.cantidad)  pc.id_compra = '56'; 

and tried this, , doesnt work

$em = $this->getentitymanager();   $query = $em->createquery('update orm\entity\producto p '  . 'left join orm\entity\productocompra pc p.id = pc.idproducto '  . 'set p.cantidad = (p.cantidad - pc.cantidad) '  . 'where pc.idcompra = :fc ')  ->setparameter('fc', $facturacompra); 

similar question @ here, see join not supported in update or delete queries.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -