CacheCollector::get

public CacheCollector::get($key)

Gets value from the cache.

Parameters

string $key: Key that identifies the data.

Return value

mixed The corresponding cache data.

Overrides CacheCollectorInterface::get

File

core/lib/Drupal/Core/Cache/CacheCollector.php, line 142

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

public function get($key) {
  $this->lazyLoadCache();
  if (isset($this->storage[$key]) || array_key_exists($key, $this->storage)) {
    return $this->storage[$key];
  }
  else {
    return $this->resolveCacheMiss($key);
  }
}
doc_Drupal
2016-10-29 08:49:22
Comments
Leave a Comment

Please login to continue.