function CacheCollector::get

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::get()

File

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

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);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.