[DCOM-287] [GH-369] [RFC] Load parent classes when loading metadata from cache Created: 22/May/15  Updated: 22/May/15

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


This issue is created automatically through a Github pull request on behalf of gonzalovilaseca:

Url: https://github.com/doctrine/common/pull/369


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 extension`` mapped field.

On first request metadata for both ``Class A`` and ``Class 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?

Generated at Sat May 23 15:03:21 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.