public function addCache(Cache $cache) { $backend = $cache->getBackend(); if (!$backend instanceof LoggingBackend) { $backend = new LoggingBackend($backend, $this->logger); } $cache->setBackend($backend); $this->addLogger($backend->getLogger()); }
public function testId() { $this->assertEquals('foo', $this->cache->id('foo')); $this->assertEquals('foo:bar', $this->cache->id('foo', 'bar')); Cache::$namespaceSeparator = '-'; $this->assertEquals('foo-bar', $this->cache->id('foo', 'bar')); Cache::$namespaceSeparator = ':'; }
/** * @param array $model * @return mixed|void */ public function setModel($model) { $this->model = $model; $this->cache->set($this->modelName, $model); }