Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Load parent classes when loading metadata from cache #369

Closed
wants to merge 1 commit into from
Closed

[RFC] Load parent classes when loading metadata from cache #369

wants to merge 1 commit into from

Commits on May 22, 2015

  1. [RFC] Load parent classes when loading metadata from cache

    This can be done more neatly, but before putting more time in it I'd like to check if it's a good idea.
    I came across this solution because we had a problem with Gedmo extensions when caching metadata in Redis, this is our scenario:
    ```
    Class A extends B;
    ```
    ```
    ``Class B`` has a ``Gedmo`` mapped field.
    
    On first request metadata for both ``A`` and ``B`` is cached in Redis.
    
    On second request ``AbstractClassMetadataFactory`` loads ``Class A`` from Redis.
    
    Gedmo extension loops through all ``Class A`` parents and calls method ``hasMetadataFor($parentClass)`` in ``AbstractClassMetadataFactory``, only ``Class A`` metadata has been loaded previously, therefore ``hasMetadataFor($parentClass)`` returns false, and ``Gedmo`` then skips the parent class.
    
    Should Gedmo exension load the metadata for the parent class or should it be done as proposed in this PR?
    gonzalovilaseca committed May 22, 2015
    Configuration menu
    Copy the full SHA
    a780871 View commit details
    Browse the repository at this point in the history