public function CacheDecorator::clearCachedDefinitions

Implements \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface::clearCachedDefinitions().

Overrides CachedDiscoveryInterface::clearCachedDefinitions

File

drupal/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php, line 157
Definition of Drupal\Core\Plugin\Discovery\CacheDecorator.

Class

CacheDecorator
Enables static and persistent caching of discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function clearCachedDefinitions() {

  // If there are any cache tags, clear cache based on those.
  if (!empty($this->cacheTags)) {
    cache($this->cacheBin)
      ->deleteTags($this->cacheTags);
  }
  else {
    if (isset($this->cacheKey)) {
      cache($this->cacheBin)
        ->delete($this->cacheKey);
    }
  }
  $this->definitions = NULL;
}