for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Onoi\Cache;
use Doctrine\Common\Cache\Cache as DoctrineCacheClient;
/**
* Doctrine Cache decorator
*
* @license GNU GPL v2+
* @since 1.0
* @author mwjames
*/
class DoctrineCache implements Cache {
* @var DoctrineCacheClient
private $cache = null;
* @param DoctrineCacheClient $cache
public function __construct( DoctrineCacheClient $cache ) {
$this->cache = $cache;
}
* {@inheritDoc}
public function fetch( $id ) {
return $this->cache->fetch( $id );
public function contains( $id ) {
return $this->cache->contains( $id );
public function save( $id, $data, $ttl = 0 ) {
$this->cache->save( $id, $data, $ttl );
public function delete( $id ) {
return $this->cache->delete( $id );
public function getStats() {
return $this->cache->getStats();
* @since 1.2
public function getName() {
return __CLASS__ . '::' . get_class( $this->cache );