I'm having a huge problem with ORM QueryBuilder. What I need to do is:
I need to fetch order with count of its products and plenty of associated entities (associated with order), but I assume they're not relevant here. I also need to order result by that count.
Could anyone give me an example of how this can be achieved? I would like to avoid "inline" DQLs if possible.
Doctrine Query Builder. You are supposed to left joinproductsfromorderand then group byorder id. You can haveCOUNT(product.id)in your select statement. Let me know if you need a code snippet.