[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


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 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 Oct 06 22:35:40 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.