Smile\ElasticsuiteVirtualCategory\Model\Layer\Filter\Category::loadUsingCache PHP Метод

loadUsingCache() приватный Метод

Load data from the cache if exits. Use a callback on the current category virtual root if not yet present into the cache.
private loadUsingCache ( string $callback ) : mixed
$callback string name of the virtual rule method to be used for actual loading.
Результат mixed
    private function loadUsingCache($callback)
    {
        $category = $this->getDataProvider()->getCategory();
        $cacheKey = implode('|', [$callback, $category->getStoreId(), $category->getId()]);
        $data = $this->cache->load($cacheKey);
        if ($data !== false) {
            $data = unserialize($data);
        }
        if ($data === false) {
            $virtualRule = $category->getVirtualRule();
            $data = call_user_func_array([$virtualRule, $callback], [$category]);
            $cacheData = serialize($data);
            $this->cache->save($cacheData, $cacheKey, [\Magento\Catalog\Model\Category::CACHE_TAG]);
        }
        return $data;
    }