Skip to content

Replaced the hard coded classname into static in the Entity Manager, in order to allow EntityManager extension#454

Closed
HarmenM wants to merge 1 commit intodoctrine:masterfrom
HarmenM:master
Closed

Replaced the hard coded classname into static in the Entity Manager, in order to allow EntityManager extension#454
HarmenM wants to merge 1 commit intodoctrine:masterfrom
HarmenM:master

Conversation

@HarmenM
Copy link

@HarmenM HarmenM commented Sep 25, 2012

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

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
@doctrinebot
Copy link

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:

http://doctrine-project.org/jira/browse/DDC-2041

@stof
Copy link
Member

stof commented Sep 25, 2012

I'm not sure it is worth it as the EntityManager has not been designed for inheritance anyway.

@henrikbjorn
Copy link

I think this have been suggested a few times and rejected every time.

@HarmenM
Copy link
Author

HarmenM commented Sep 25, 2012

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.

@henrikbjorn
Copy link

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.

@guilhermeblanco
Copy link
Member

EntityManager was not designed for inheritance and this change affects its possibility.
We only haven't declared as final because some very conscious people do have real requirements and we allow the extension through composition.
Closing the ticket, marked as "won't fix".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants