[PR #6155] [WIP][Bugfix] Eager loaded associations and orderBy mappings #9871

Closed
opened 2026-01-22 16:05:41 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/6155

State: closed
Merged: No


This PR aims to solve #4256

I'm starting with the regression test. I've been digging and I believe this has mostly to do with the fact that the orderBy clause is read when UnitOfWork calls the EntityPersister::loadOneToManyCollection, while eager loading is done at EntityPersister level through the join analysis in getSelectColumnsSQL().

I could hack into the getSelectColumnsSQL() method and leave some sort of orderedJoinedQuery mark somewhere, but it will be hacky.

I'm opening this here to ask for opinions on how this could be tackled. I'm available to get it done, just point my fingers in the right direction!

Cheers

**Original Pull Request:** https://github.com/doctrine/orm/pull/6155 **State:** closed **Merged:** No --- This PR aims to solve #4256 I'm starting with the regression test. I've been digging and I believe this has mostly to do with the fact that the orderBy clause is read when `UnitOfWork` calls the `EntityPersister::loadOneToManyCollection`, while eager loading is done at `EntityPersister` level through the join analysis in `getSelectColumnsSQL()`. I could hack into the `getSelectColumnsSQL()` method and leave some sort of `orderedJoinedQuery` mark somewhere, but it _will be hacky_. I'm opening this here to ask for opinions on how this could be tackled. I'm available to get it done, just point my fingers in the right direction! Cheers
admin added the pull-request label 2026-01-22 16:05:41 +01:00
admin closed this issue 2026-01-22 16:05:41 +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#9871