Rinvex\Repository\Traits\Cacheable::storeCacheKeys PHP Method

storeCacheKeys() protected method

Store cache keys by mimicking cache tags.
protected storeCacheKeys ( string $class, string $method, string $hash ) : void
$class string
$method string
$hash string
return void
    protected function storeCacheKeys($class, $method, $hash)
    {
        $keysFile = $this->getContainer('config')->get('rinvex.repository.cache.keys_file');
        $cacheKeys = $this->getCacheKeys($keysFile);
        if (!isset($cacheKeys[$class]) || !in_array($method . '.' . $hash, $cacheKeys[$class])) {
            $cacheKeys[$class][] = $method . '.' . $hash;
            file_put_contents($keysFile, json_encode($cacheKeys));
        }
    }