Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-751

Simplify overwriting ClassMetadataFactory

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA3
    • Fix Version/s: 2.0
    • Component/s: None
    • Security Level: All
    • 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.

        Activity

        Hide
        Roman S. Borschel added a comment -

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

        Show
        Roman S. Borschel added a comment - What do you suggest? Making this part of the configuration? Do we need to extract an interface?
        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Hide
        Roman S. Borschel added a comment -

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

        Show
        Roman S. Borschel added a comment - Do you think this is essential to be included in 2.0 ?
        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Hide
        Benjamin Eberlei added a comment -

        This is already fixed.

        Show
        Benjamin Eberlei added a comment - This is already fixed.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: