You are here

public function CacheCollector::clear in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::clear()
  2. 10 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::clear()

Clears the collected cache entry.

Overrides CacheCollectorInterface::clear

1 call to CacheCollector::clear()
AliasWhitelist::clear in core/modules/path_alias/src/AliasWhitelist.php
Clears the collected cache entry.
1 method overrides CacheCollector::clear()
AliasWhitelist::clear in core/modules/path_alias/src/AliasWhitelist.php
Clears the collected cache entry.

File

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

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

public function clear() {
  $this
    ->reset();
  if ($this->tags) {
    Cache::invalidateTags($this->tags);
  }
  else {
    $this->cache
      ->delete($this
      ->getCid());
  }
}