DDC-897: Make ClassMetadataFactory configurable #1116

Closed
opened 2026-01-22 13:02:43 +01:00 by admin · 7 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 27, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

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

Originally created by @doctrinebot on GitHub (Nov 27, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: It was requested lots of times: ClassMetadataFactory has to be overrideable for some frameworks to operate!
admin added the Improvement label 2026-01-22 13:02:43 +01:00
admin closed this issue 2026-01-22 13:02:43 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 27, 2010):

Comment created by @beberlei:

Implemented

@doctrinebot commented on GitHub (Nov 27, 2010): Comment created by @beberlei: Implemented
Author
Owner

@doctrinebot commented on GitHub (Nov 27, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 27, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Nov 29, 2010):

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 commented on GitHub (Nov 29, 2010): 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.
Author
Owner

@doctrinebot commented on GitHub (Nov 29, 2010):

Comment created by @beberlei:

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

@doctrinebot commented on GitHub (Nov 29, 2010): Comment created by @beberlei: No, the only methods that should be overwritten are already protected or public.
Author
Owner

@doctrinebot commented on GitHub (Nov 29, 2010):

Comment created by ayhan:

thanks for the quick answer.

examples:

  • method getMetadataFor is public and probably candidate #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 commented on GitHub (Nov 29, 2010): Comment created by ayhan: thanks for the quick answer. examples: - method getMetadataFor is public and probably candidate #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.
Author
Owner

@doctrinebot commented on GitHub (Nov 29, 2010):

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 commented on GitHub (Nov 29, 2010): 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.
Author
Owner

@doctrinebot commented on GitHub (Nov 29, 2010):

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?

@doctrinebot commented on GitHub (Nov 29, 2010): 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1116