capgemini / drupal_doctrine_cache
A mechanism for doctrine to cache using Drupal's caching API.
Installs: 3 631
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 14
Forks: 5
Open Issues: 2
Requires
- php: >=5.4.0
- doctrine/common: 2.4.*
Requires (Dev)
- phpunit/phpunit: ~4.6
This package is not auto-updated.
Last update: 2024-11-09 15:36:13 UTC
README
This repository provides a Doctrine cache that will use the Drupal 6/7 caching API for storage.
It's fairly straightforward to use, just configure your EntityManager with a new instance of the cache.
$cache = new \Capgemini\Cache\DrupalDoctrineCache();
$entityManagerConfiguration->setMetaDataCacheImpl($cache);
$entityManagerConfiguration->setQueryCacheImpl($cache);
$entityManagerConfiguration->setResultCacheImpl($cache);
By default the cache will use the 'cache' table. You can change this :-
$cache->setCacheTable('my_cache_table');
Obviously you need to ensure that the table exists and is usable by the Drupal caching API.