CacheCollector::has

public CacheCollector::has($key)

Returns whether data exists for this key.

Parameters

string $key: Key that identifies the data.

Overrides CacheCollectorInterface::has

File

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

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

1
2
3
4
5
public function has($key) {
  // Make sure the value is loaded.
  $this->get($key);
  return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.