DDC-751: Simplify overwriting ClassMetadataFactory #926

Closed
opened 2026-01-22 12:55:47 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 17, 2010).

Jira issue originally created by user @beberlei:

Currently its very hard (only via Reflection Hack) to overwrite the ClassMetadataFactory used. This should be simplified to allow people to implement their own ClassMetadataFacfotry or ClassMetadata instances.

Originally created by @doctrinebot on GitHub (Aug 17, 2010). Jira issue originally created by user @beberlei: Currently its very hard (only via Reflection Hack) to overwrite the ClassMetadataFactory used. This should be simplified to allow people to implement their own ClassMetadataFacfotry or ClassMetadata instances.
admin added the Improvement label 2026-01-22 12:55:47 +01:00
admin closed this issue 2026-01-22 12:55:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 26, 2010):

Comment created by romanb:

What do you suggest? Making this part of the configuration? Do we need to extract an interface?

@doctrinebot commented on GitHub (Aug 26, 2010): Comment created by romanb: What do you suggest? Making this part of the configuration? Do we need to extract an interface?
Author
Owner

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

Comment created by @beberlei:

No i don't think an interface is necessary. The class has much logic that is rather important. However you might want to extend it here and there: DisconnectedMetadataFactory is one example.

A method on Doctrine\ORM\Configuration sounds very good.

@doctrinebot commented on GitHub (Aug 29, 2010): Comment created by @beberlei: No i don't think an interface is necessary. The class has much logic that is rather important. However you might want to extend it here and there: DisconnectedMetadataFactory is one example. A method on Doctrine\ORM\Configuration sounds very good.
Author
Owner

@doctrinebot commented on GitHub (Aug 30, 2010):

Comment created by romanb:

Do you think this is essential to be included in 2.0 ?

@doctrinebot commented on GitHub (Aug 30, 2010): Comment created by romanb: Do you think this is essential to be included in 2.0 ?
Author
Owner

@doctrinebot commented on GitHub (Aug 30, 2010):

Comment created by @beberlei:

nope. The problem is that the CMF constructor expects the EntityManager, this means that you would only be able to configure the class name.

But the configuration is also timing depend, because the CMF is stored inside EntityManager::$metadataFactory and should not be dynamically overwritable AFTER the Entity Manager was created this could create funny problems.

@doctrinebot commented on GitHub (Aug 30, 2010): Comment created by @beberlei: nope. The problem is that the CMF constructor expects the EntityManager, this means that you would only be able to configure the class name. But the configuration is also timing depend, because the CMF is stored inside EntityManager::$metadataFactory and should not be dynamically overwritable AFTER the Entity Manager was created this could create funny problems.
Author
Owner

@doctrinebot commented on GitHub (Dec 28, 2010):

Comment created by @beberlei:

This is already fixed.

@doctrinebot commented on GitHub (Dec 28, 2010): Comment created by @beberlei: This is already fixed.
Author
Owner

@doctrinebot commented on GitHub (Dec 28, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 28, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#926