Skip to content

Loading…

DDC-751: Simplify overwriting ClassMetadataFactory #5265

Closed
doctrinebot opened this Issue · 6 comments

1 participant

@doctrinebot

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.

@doctrinebot

Comment created by romanb:

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

@doctrinebot

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

Comment created by romanb:

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

@doctrinebot

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

Comment created by @beberlei:

This is already fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.