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.
Comment created by romanb:
What do you suggest? Making this part of the configuration? Do we need to extract an interface?
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.
Do you think this is essential to be included in 2.0 ?
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.
This is already fixed.
Issue was closed with resolution "Fixed"