mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #9106] Query::getResult and Query::toIterable results differ when selecting multiple entities.
#11375
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?
Original Pull Request: https://github.com/doctrine/orm/pull/9106
State: closed
Merged: No
While working on #9098 I've found this bug so I open this PR with a test for the exposed bug.
For the test in the PR with 4 articles (a), for 1 author (u),
Query::getResultreturns 5 results because it only returns one entity per position, whileQuery::toIterablereturns 4 results because it combines the selected entities.Query::getResultoutput is[a1, u, a2, a3, a4]Query::toIterableoutput is[[a1, u], [a2, u], [a3, u], [a4, u]]I prefer the
Query::toIterableoutput, so my questions are:Query::toIterableto mimic theQuery::getResultoutput?Querywith the same output currently produced byQuery::toIterable?Query::toIterableandQuery::getResultcan differ when selecting multiple entities?