for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Lug 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 Lug\Component\Storage\Model;
use Doctrine\Common\Cache\Cache;
/**
* @author GeLo <[email protected]>
class DoctrineStorage implements StorageInterface
{
* @var Cache
private $cache;
* @param Cache $cache
public function __construct(Cache $cache)
$this->cache = $cache;
}
* {@inheritdoc}
public function offsetExists($offset)
return $this->cache->contains($offset);
public function offsetGet($offset)
if (($data = $this->cache->fetch($offset)) !== false) {
return $data;
public function offsetSet($offset, $value)
$this->cache->save($offset, $value);
public function offsetUnset($offset)
$this->cache->delete($offset);