You are here

public function CacheCollector::has in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()
  2. 9 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\Cache

Code

public function has($key) {

  // Make sure the value is loaded.
  $this
    ->get($key);
  return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
}