Replaced the hard coded classname into static in the Entity Manager, in order to allow EntityManager extension#454
Replaced the hard coded classname into static in the Entity Manager, in order to allow EntityManager extension#454HarmenM wants to merge 1 commit intodoctrine:masterfrom HarmenM:master
Conversation
Changing the hard coded reference to the EntityManager class into static in the factory method to create an entity manager instance (new EntityManager() --> new static()). In order to make it possible to extend the EntityManager class
|
Hello, thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link: |
|
I'm not sure it is worth it as the EntityManager has not been designed for inheritance anyway. |
|
I think this have been suggested a few times and rejected every time. |
|
If that is the case, the EntityManager should be considered final... Nonetheless, I still think that there are plausible reasons to have an extended EntityManager. By changing the hard coded reference into a LSB, you at least leave the choice to the developer whether to extend or not. |
|
You can achieve the same thing by using composition and wrapping the EntityManager in your own Manager that implements the ObjectManagerInterface. For a change on this getting merged you have to present a compelling use case. Otherwise Composition is recommended. |
|
EntityManager was not designed for inheritance and this change affects its possibility. |
Changing the hard coded reference to the EntityManager class into static in the factory method to create an entity manager instance
(new EntityManager() --> new static()). In order to make it possible to extend the EntityManager class