As of newer version of Doctrine2, I know there is Doctrine\ORM\Configuration#setHydrationCacheImpl()
to pass such as MemcacheCache, etc.
But how can it be done in container?
I'm using two entity_manager: named "default" and "other".
I first tried defining hydration_cache into config.yml like
doctrine:
orm:
default_entity_manager: default
...
entity_managers:
default:
...
metadata_cache_driver:
type: service
id: memcache_driver
...
hydration_cache_driver:
type: service
id: memcache_driver
...
other:
...
note: where memcache_driver
is defined by me, instanceof Doctrine\Common\Cache\MemcacheCache
then I got Unrecognized options "hydration_cache_driver" under "doctrine.orm.entity_managers.default"
.
I also tried to directly tweak container in AppKernel#buildContainer, but there's no instances of \Doctrine\ORM\Configuration defined as service, so I couldn't retrieve the Configuration instance.
Any suggestions are welcome.
EDIT:
I'm sure that there is feature for caching hydrated object is re-implemented as of Doctrine 2.2.2.
http://www.doctrine-project.org/jira/browse/DDC-1766
For other simple services, I can easily add methods to call by overwriting whole definitions like
service1:
...
calls:
[method calls]
but for the entity_manager, I'm not sure how to add method calls to them.
So my question in other words, how to configure orm at lower level like without using semantic configuration?