public function loadCache($cacheKey)
{
if (!isset($this->localCache[$cacheKey])) {
$data = $this->cache->load($cacheKey);
if ($data) {
$data = unserialize($data);
}
$this->localCache[$cacheKey] = $data;
}
return $this->localCache[$cacheKey];
}
/** * {@inheritDoc} */ public function getSpellingType(RequestInterface $request) { $cacheKey = $this->getCacheKey($request); $spellingType = $this->cacheHelper->loadCache($cacheKey); if ($spellingType === false) { $spellingType = $this->loadSpellingType($request); $this->cacheHelper->saveCache($cacheKey, $spellingType, [$request->getIndex()]); } return $spellingType; }