-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify UnitOfWork::HINT_DEFEREAGERLOAD exists and is true #10808
Verify UnitOfWork::HINT_DEFEREAGERLOAD exists and is true #10808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having the same problem and this definitely solved it.
Can you please add tests? |
Please read the contribution guide, it shows how to deal with failing checks locally. |
Yep, sorry, I forgot to run cs. It is fixed. |
Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble. How to do that?
|
9aa11b7
to
7986fc6
Compare
All done. |
The base branch was changed.
Thanks @oscmarb ! |
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 whenHINT_DEFEREAGERLOAD
istrue
.