public function CacheCollector::clear

public CacheCollector::clear()

Clears the collected cache entry.

Overrides CacheCollectorInterface::clear

File

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

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!CacheCollector.php/function/CacheCollector::clear/8.1.x