for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Ivory Http Adapter package.
*
* (c) Eric GELOEN <[email protected]>
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Ivory\HttpAdapter\Event\Cache\Adapter;
use Doctrine\Common\Cache\Cache;
/**
* @author GeLo <[email protected]>
class DoctrineCacheAdapter implements CacheAdapterInterface
{
* @var Cache
private $cache;
* @param Cache $cache
public function __construct(Cache $cache)
$this->cache = $cache;
}
* {@inheritdoc}
public function has($id)
return $this->cache->contains($id);
public function get($id)
return $this->has($id) ? $this->cache->fetch($id) : null;
public function set($id, $data, $lifeTime = 0)
return $this->cache->save($id, $data, $lifeTime);
public function remove($id)
return $this->cache->delete($id);