function CacheCollector::get
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::get()
- 10 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::get()
- 9 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::get()
- 8.9.x core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::get()
Gets value from the cache.
Parameters
string $key: Key that identifies the data.
Return value
mixed The corresponding cache data.
Overrides CacheCollectorInterface::get
8 calls to CacheCollector::get()
- CacheCollector::has in core/
lib/ Drupal/ Core/ Cache/ CacheCollector.php - LibraryDiscoveryCollector::applyLibrariesExtend in core/
lib/ Drupal/ Core/ Asset/ LibraryDiscoveryCollector.php - Applies the libraries-extend specified by the active theme.
- LibraryDiscoveryCollector::getLibrariesByExtension in core/
lib/ Drupal/ Core/ Asset/ LibraryDiscoveryCollector.php - LibraryDiscoveryCollector::getLibraryDefinitions in core/
lib/ Drupal/ Core/ Asset/ LibraryDiscoveryCollector.php - Returns the library definitions for a given extension.
- MenuActiveTrail::getActiveTrailIds in core/
lib/ Drupal/ Core/ Menu/ MenuActiveTrail.php - This implementation caches all active trail IDs per route match for *all* menus whose active trails are calculated on that page. This ensures 1 cache get for all active trails per page load, rather than N.
4 methods override CacheCollector::get()
- AliasPrefixList::get in core/
modules/ path_alias/ src/ AliasPrefixList.php - IconCollector::get in core/
lib/ Drupal/ Core/ Theme/ Icon/ IconCollector.php - State::get in core/
lib/ Drupal/ Core/ State/ State.php - ThemeRegistry::get in core/
lib/ Drupal/ Core/ Utility/ ThemeRegistry.php
File
-
core/
lib/ Drupal/ Core/ Cache/ CacheCollector.php, line 143
Class
- CacheCollector
- Default implementation for CacheCollectorInterface.
Namespace
Drupal\Core\CacheCode
public function get($key) {
$this->lazyLoadCache();
if (\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.