Jarves\Cache\Backend\AbstractCache::get PHP Метод

get() публичный Метод

Returns data of the specified cache-key.
public get ( string $key ) : mixed
$key string
Результат mixed
    public function get($key)
    {
        if (isset($this->cache[$key])) {
            return $this->cache[$key];
        }
        $cache = $this->doGet($key);
        if (false === $cache) {
            return null;
        }
        $this->cache[$key] = json_decode($cache, true);
        return $this->cache[$key];
    }

Usage Example

Пример #1
0
 public function latencies(&$response)
 {
     $lastLatency = $this->distributedCache->get('core/latency');
     $result = array('frontend' => 0, 'backend' => 0, 'database' => 0, 'session' => 0, 'cache' => 0);
     foreach ($result as $key => &$value) {
         $value = isset($lastLatency[$key]) ? $lastLatency[$key] : array();
     }
     $response['JarvesBundle/latencies'] = $result;
 }
All Usage Examples Of Jarves\Cache\Backend\AbstractCache::get