Skip to content
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

DDC-897: Make ClassMetadataFactory configurable #5422

Closed
doctrinebot opened this issue Nov 27, 2010 · 7 comments
Closed

DDC-897: Make ClassMetadataFactory configurable #5422

doctrinebot opened this issue Nov 27, 2010 · 7 comments
Assignees
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @beberlei:

It was requested lots of times: ClassMetadataFactory has to be overrideable for some frameworks to operate!

@doctrinebot
Copy link
Author

Comment created by @beberlei:

Implemented

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot
Copy link
Author

Comment created by ayhan:

that's really great news.

but i think, the access levels of its class properties and methods should be changed from private to protected or is there are reason for not doing that?
It would make it easier to subclass it, if you p.e. only want to override one method.

@doctrinebot
Copy link
Author

Comment created by @beberlei:

No, the only methods that should be overwritten are already protected or public.

@doctrinebot
Copy link
Author

Comment created by ayhan:

thanks for the quick answer.

examples:

  • method getMetadataFor is public and probably candidate EntityManager: add setRepository() method #1 to get overwritten... but that's only possible to a certain degree as the subclass cannot access the EntityManager.
  • method getAllMetadata is public, but as the subclass cannot access the initialized property, not really overwrittable.

i might have overlooked something, as i just grabbed the updated version.

@doctrinebot
Copy link
Author

Comment created by @beberlei:

no, the primary method to be overwritten are:

protected function newClassMetadataInstance($className)
protected function getParentClasses($name)

All the other code should not be touched as it handles the caching loading and such.

@doctrinebot
Copy link
Author

Comment created by ayhan:

for me it's getMetadataFor :-D as i need another alias mechanism.

but don't get me wrong, i think the changes you already made are sufficent for my case... but it's confusing, therefore the comment.

for the method getParentClasses that you mentioned:

how would you access the driver property in the subclass?

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

No branches or pull requests

2 participants