function CacheCollector::has

Same name in other branches
  1. 9 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()
  2. 8.9.x core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()
  3. 11.x core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::has()

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 \array_key_exists($key, $this->storage);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.