mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
QueryBuilder with manual join on two entities return mixed lines. #5801
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 @Kytrix on GitHub (Dec 12, 2017).
Originally assigned to: @Kytrix on GitHub.
Hello,
I'm using:
doctrine/common v2.7.3
I have 2 entities, Dispatch and PackagingContent, both are virtually linked with a field name product_id. There is no relation in entity between them.
Inside my repository, I made a manual join:
Inside my results, instead of getting 50 lines of results, I get 100 lines with:
so 50 lines of each entities mixed !
it's strange, there is a way to get 50 lines with an array or collection with the two enities inside? like this:
@lcobucci commented on GitHub (Dec 18, 2017):
@Kytrix it's kind of hard to understand what you're facing without the map of your entities... could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing.
You can find examples on
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket@malukenho commented on GitHub (Feb 20, 2018):
@Kytrix it seems like doctrine doesn't support it. But you can fix it by using a
DTO.Then on your query builder you configure the
selectas:@zeromodule commented on GitHub (Apr 16, 2024):
@malukenho it doesn't work with entities. Only with scalar values.