persist($key); } /** * {@inheritdoc} */ public function resolveCacheMiss($key) { $this->cacheMisses++; if (isset($this->cacheMissData[$key])) { $this->storage[$key] = $this->cacheMissData[$key]; $this->persist($key); return $this->cacheMissData[$key]; } } /** * Sets data to return from a cache miss resolve. * * @param string $key * The key being looked for. * @param mixed $value * The value to return. */ public function setCacheMissData($key, $value) { $this->cacheMissData[$key] = $value; } /** * Returns the number of cache misses. * * @return int * Number of calls to the resolve cache miss method. */ public function getCacheMisses() { return $this->cacheMisses; } }