Closed timo002 closed 4 years ago
I understand that the join might result in multiple rows, but I don't care about it.
But that is the point why it's not allowed by default, it's an open invitation to get weird bugs and crashes. I think best route here would be to provide a custom adapter implementation providing the necessary transformations.
A demonstration of what you can achieve can be found in the tests at https://github.com/omines/datatables-bundle/blob/master/tests/Fixtures/AppBundle/DataTable/Adapter/CustomORMAdapter.php
I need to do a simple join to populate the datatables table. If I would write a query in my repository, I would write this:
Doing this in the custom query part, it fails on
Iterate with fetch join in class App\Entity\Stock using association tyre not allowed.
Probably the same issue as in this open issue: https://github.com/omines/datatables-bundle/issues/30I understand that the join might result in multiple rows, but I don't care about it. And if I would, I could allways use a group by. How would I be able to get this working, I need the join on s.supplier_id.
Tyre.stocks is OneToMany relation