-
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
Check hint value before considering instance read-only #11768
Check hint value before considering instance read-only #11768
Conversation
It seems there are CI jobs failing. Please take a look at this guide for more on how to handle those. |
Does this affect 2.x? If yes, please retarget to 2.20.x, and we will merge it up. Also, it would be nice to have a test covering this, inside |
bf316ed
to
811f7d0
Compare
811f7d0
to
62a66ef
Compare
@greg0ire thanks for reviewing. Retargeting is done with one unit test. |
Please improve your commit message according to the contributing guide. 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?
|
This fixes a bug that occurs when calling setHint(Query::HINT_READ_ONLY, false) from a query object. UnitOfWork checks if this hint exists without considering the value passed as second argument. Handling the second parameter improves consistency with documentation. https://www.doctrine-project.org/projects/doctrine-orm/en/2.20/reference/improving-performance.html#read-only-entities
ca1f6da
to
4a9101f
Compare
Thanks for your patience. I'm not used to contributing to open-source projects . |
And thanks for bearing with me, the new commit message is 👌 |
Documentation suggests that HINT_READ_ONLY accept a boolean value.
https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/improving-performance.html#read-only-entities
But UnitOfWork only check if hint is set to register new Entity instance as read-only.
Using the value parameter will code more consistent to documentation.