public function ThemeRegistry::resolveCacheMiss in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Utility/ThemeRegistry.php \Drupal\Core\Utility\ThemeRegistry::resolveCacheMiss()
Resolves a cache miss.
When an offset is not found in the object, this is treated as a cache miss. This method allows classes using this implementation to look up the actual value and allow it to be cached.
Parameters
string $key: The offset that was requested.
Return value
mixed The value of the offset, or NULL if no value was found.
Overrides CacheCollector::resolveCacheMiss
1 call to ThemeRegistry::resolveCacheMiss()
- ThemeRegistry::get in core/
lib/ Drupal/ Core/ Utility/ ThemeRegistry.php - Gets value from the cache.
File
- core/
lib/ Drupal/ Core/ Utility/ ThemeRegistry.php, line 122
Class
- ThemeRegistry
- Builds the run-time theme registry.
Namespace
Drupal\Core\UtilityCode
public function resolveCacheMiss($key) {
if (!isset($this->completeRegistry)) {
$this->completeRegistry = \Drupal::service('theme.registry')
->get();
}
$this->storage[$key] = $this->completeRegistry[$key];
if ($this->persistable) {
$this
->persist($key);
}
return $this->storage[$key];
}