[PR #9106] Query::getResult and Query::toIterable results differ when selecting multiple entities. #11375

Open
opened 2026-01-22 16:10:35 +01:00 by admin · 0 comments
Owner

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::getResult returns 5 results because it only returns one entity per position, while Query::toIterable returns 4 results because it combines the selected entities.

  • Query::getResult output is [a1, u, a2, a3, a4]
  • Query::toIterable output is [[a1, u], [a2, u], [a3, u], [a4, u]]

I prefer the Query::toIterable output, so my questions are:

  • must we fix Query::toIterable to mimic the Query::getResult output?
  • if we fix it, must we add another iterable funcion to Query with the same output currently produced by Query::toIterable?
  • can we assume that output from Query::toIterable and Query::getResult can differ when selecting multiple entities?
**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::getResult` returns 5 results because it only returns one entity per position, while `Query::toIterable` returns 4 results because it combines the selected entities. - `Query::getResult` output is `[a1, u, a2, a3, a4]` - `Query::toIterable` output is `[[a1, u], [a2, u], [a3, u], [a4, u]]` I prefer the `Query::toIterable` output, so my questions are: - must we fix `Query::toIterable` to mimic the `Query::getResult` output? - if we fix it, must we add another iterable funcion to `Query` with the same output currently produced by `Query::toIterable`? - can we assume that output from `Query::toIterable` and `Query::getResult` can differ when selecting multiple entities?
admin added the pull-request label 2026-01-22 16:10:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11375