Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thank you, actually the relation is in ComprasProductosSucursal. I'll update the question with the relations. Also I don't have a collection named ps, it's the alias I've set for the entity ComprasProductosSucursal Commented Mar 15, 2015 at 17:49
  • Just change s.ps to s.whateverYouCalled it. Commented Mar 15, 2015 at 17:54
  • I've updated the question with the ORMs, I tried your change: SELECT s FROM AppBundle:Sucursales s LEFT JOIN s.ComprasProductosSucursales ps but I get: [Semantical Error] line 0, col 76 near 'ps': Error: Class AppBundle\Entity\Sucursales has no association named ComprasProductosSucursales Commented Mar 15, 2015 at 18:03
  • From your mapping it looks like you have a relation from ComprasProductosSucursales to Sucursales but not the other way around. So doctrine will not understand the query. You need to add the relation or select from ComprasProductosSucursales and join Sucursales. Commented Mar 15, 2015 at 18:09
  • I though about the second approach but I need this query to get all values from Sucursales and if there's corresponding values in ComprasProductosSucursales then get them, if not then show them values as null. Commented Mar 15, 2015 at 18:21