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. 9 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::clearCachedDefinitions()
  3. 10 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::clearCachedDefinitions()
1 call to DefaultPluginManager::clearCachedDefinitions()
HelpSectionManager::clearCachedDefinitions in core/modules/help_topics/src/HelpSectionManager.php
Clears static and persistent plugin definition caches.
1 method overrides DefaultPluginManager::clearCachedDefinitions()
HelpSectionManager::clearCachedDefinitions in core/modules/help_topics/src/HelpSectionManager.php
Clears static and persistent plugin definition caches.

File

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

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.