mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Why I cannot retrieve computed fields along with collections? #5412
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JCMais on GitHub (Feb 7, 2017).
Say I have 2 entities,
ProductandTag, whereProducthas an one-to-many relationship withTag.Using the array hydration mode, this query correctly returns the product fields with all tags (as one array):
But this returns one single tag in the array:
Why is that?
Using PHP 7 and "doctrine/orm": "~2.5.5",
@JCMais commented on GitHub (Feb 8, 2017):
I'm so dumb. To get the expected result, it's needed to group by
product.idandtags.id.