-
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
Remove readonly modifier from EntityManager #11472
Conversation
4188b77
to
92f78b3
Compare
d259d40
to
b6dbe52
Compare
I added a test case that breaks if the unitOfWork property is made readonly or if the class is made final. |
FTR: Resetting the EM is a feature that the ORM neither advertised nor documented. Reopening an EM is explicitly not supported. I'm fine merging this change to unblock downstream projects. But this reset feature should be implemented properly in this repository. We cannot maintain or support features that are monkey-patched onto our code. |
I will review this after I find time to read #5933 |
This does not fix a bug with Doctrine, and as such should target 3.2.x. We may release 3.2.0 quickly after this is merged as a courtesy to Symfony users. |
b6dbe52
to
a85bc3a
Compare
Fine to me 🚀 🚢 |
a85bc3a
to
baf96cd
Compare
@derrabus the feature request to move this feature to the ORM itself exists since 2016: #5933 |
I think, we both know the difference beware requesting a feature and implementing it. I'm aware that the request exists, bit somebody needs to do it. |
The readonly modifier has been added as if it had no consequences, but in reality it breaks the possibility to reset the EM, while this is an important capability when using it in long-running processes.
This has the same reasoning as why
@final
is used and not the real final modifier.Please see the discussion in symfony/symfony#54228 for more detailed explanations.