[DDC-751] Simplify overwriting ClassMetadataFactory Created: 17/Aug/10  Updated: 28/Dec/10  Resolved: 28/Dec/10

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.0-BETA3
Fix Version/s: 2.0
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None


 Description   

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.



 Comments   
Comment by Roman S. Borschel [ 26/Aug/10 ]

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

Comment by Benjamin Eberlei [ 29/Aug/10 ]

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.

Comment by Roman S. Borschel [ 30/Aug/10 ]

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

Comment by Benjamin Eberlei [ 30/Aug/10 ]

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.

Comment by Benjamin Eberlei [ 28/Dec/10 ]

This is already fixed.

Generated at Tue Sep 30 22:08:53 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.