You are here

public function CacheCollector::has in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 138
Contains \Drupal\Core\Cache\CacheCollector.

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);
}