public function CacheCollector::has in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()
- 10 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()
Returns whether data exists for this key.
Parameters
string $key: Key that identifies the data.
Overrides CacheCollectorInterface::has
1 method overrides CacheCollector::has()
- ThemeRegistry::has in core/
lib/ Drupal/ Core/ Utility/ ThemeRegistry.php - Returns whether data exists for this key.
File
- core/
lib/ Drupal/ Core/ Cache/ CacheCollector.php, line 134
Class
- CacheCollector
- Default implementation for CacheCollectorInterface.
Namespace
Drupal\Core\CacheCode
public function has($key) {
// Make sure the value is loaded.
$this
->get($key);
return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
}