[PR #10808] Verify UnitOfWork::HINT_DEFEREAGERLOAD exists and is true #12632

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

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

State: closed
Merged: Yes


In some EAGER relationships a proxy instance is always retrieved instead of an instance of the class. This is because there is the UnitOfWork::HINT_DEFEREAGERLOAD hint, which cannot be deactivated even when the DQL indicates that the load should be EAGER or when we execute:

$query->setHint(UnitOfWork::HINT_DEFEREAGERLOAD, false);

With the change introduced by executing the line above, the value of HINT_DEFEREAGERLOAD will be taken into account, and lazy loading will only occur when HINT_DEFEREAGERLOAD is true.

**Original Pull Request:** https://github.com/doctrine/orm/pull/10808 **State:** closed **Merged:** Yes --- In some EAGER relationships a proxy instance is always retrieved instead of an instance of the class. This is because there is the `UnitOfWork::HINT_DEFEREAGERLOAD` hint, which cannot be deactivated even when the DQL indicates that the load should be EAGER or when we execute: `$query->setHint(UnitOfWork::HINT_DEFEREAGERLOAD, false);` With the change introduced by executing the line above, the value of `HINT_DEFEREAGERLOAD` will be taken into account, and lazy loading will only occur when `HINT_DEFEREAGERLOAD` is `true`.
admin added the pull-request label 2026-01-22 16:14: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#12632