Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-897

Make ClassMetadataFactory configurable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      It was requested lots of times: ClassMetadataFactory has to be overrideable for some frameworks to operate!

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Implemented

        Show
        Benjamin Eberlei added a comment - Implemented
        Hide
        ayhan added a comment - - edited

        that's really great news.

        but i think, the access levels of its class properties and methods should be changed from private to protected or is there are reason for not doing that?
        It would make it easier to subclass it, if you p.e. only want to override one method.

        Show
        ayhan added a comment - - edited that's really great news. but i think, the access levels of its class properties and methods should be changed from private to protected or is there are reason for not doing that? It would make it easier to subclass it, if you p.e. only want to override one method.
        Hide
        Benjamin Eberlei added a comment -

        No, the only methods that should be overwritten are already protected or public.

        Show
        Benjamin Eberlei added a comment - No, the only methods that should be overwritten are already protected or public.
        Hide
        ayhan added a comment -

        thanks for the quick answer.

        examples:

        • method getMetadataFor is public and probably candidate #1 to get overwritten... but that's only possible to a certain degree as the subclass cannot access the EntityManager.
        • method getAllMetadata is public, but as the subclass cannot access the initialized property, not really overwrittable.

        i might have overlooked something, as i just grabbed the updated version.

        Show
        ayhan added a comment - thanks for the quick answer. examples: method getMetadataFor is public and probably candidate #1 to get overwritten... but that's only possible to a certain degree as the subclass cannot access the EntityManager. method getAllMetadata is public, but as the subclass cannot access the initialized property, not really overwrittable. i might have overlooked something, as i just grabbed the updated version.
        Hide
        Benjamin Eberlei added a comment -

        no, the primary method to be overwritten are:

        protected function newClassMetadataInstance($className)
        protected function getParentClasses($name)
        

        All the other code should not be touched as it handles the caching loading and such.

        Show
        Benjamin Eberlei added a comment - no, the primary method to be overwritten are: protected function newClassMetadataInstance($className) protected function getParentClasses($name) All the other code should not be touched as it handles the caching loading and such.
        Hide
        ayhan added a comment - - edited

        for me it's getMetadataFor :-D as i need another alias mechanism.

        but don't get me wrong, i think the changes you already made are sufficent for my case... but it's confusing, therefore the comment.

        for the method getParentClasses that you mentioned:

        how would you access the driver property in the subclass?

        Show
        ayhan added a comment - - edited for me it's getMetadataFor :-D as i need another alias mechanism. but don't get me wrong, i think the changes you already made are sufficent for my case... but it's confusing, therefore the comment. for the method getParentClasses that you mentioned: how would you access the driver property in the subclass?

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: