function DefaultPluginManager::clearCachedDefinitions

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::clearCachedDefinitions()
  2. 10 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::clearCachedDefinitions()
  3. 8.9.x core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::clearCachedDefinitions()

File

core/lib/Drupal/Core/Plugin/DefaultPluginManager.php, line 190

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

public function clearCachedDefinitions() {
  if ($this->cacheBackend) {
    if ($this->cacheTags) {
      // Use the cache tags to clear the cache.
      Cache::invalidateTags($this->cacheTags);
    }
    else {
      $this->cacheBackend
        ->delete($this->cacheKey);
    }
  }
  $this->definitions = NULL;
}

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