I have a lot of entities with entity associations as keys and I'm trying to use second level cache.
Looking at the method: UnitOfWork::createEntity($className, array $data, &$hints = array())
- $className: contains the class name
- $data: contains the raw data (the row coming from the database)
Enabling the second level cache, DefaultQueryCache::get calls the createEntity method passing a $data that contains object entities and some raw data (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultQueryCache.php#L155).
I think that DefaultQueryCache should not introduce a variant of $data and should create a compatible version of $data.