You are browsing a version that has not yet been released. |
Caching
DoctrineModule provides bridging between Laminas\Cache and Doctrine\Common\Cache. This may be useful in case you want to share configured cache instances across doctrine, symfony and laminas projects.
You may use Laminas\Cache
within your doctrine-related projects as
following:
You may use Doctrine\Common\Cache
within your Laminas projects as
following:
1 $doctrineCache = new \Doctrine\Common\Cache\ArrayCache(); // any doctrine cache is OK here
$adapterOptions = new \Laminas\Cache\Storage\Adapter\AdapterOptions();
$laminasCacheStorage = new \DoctrineModule\Cache\DoctrineCacheStorage($adapterOptions, $doctrineCache);
// now use $laminasCacheStorage as a normal Laminas\Cache\Storage\StorageInterface instance.
2
3
4