function DefaultPluginManager::clearCachedDefinitions

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

Overrides CachedDiscoveryInterface::clearCachedDefinitions

4 calls to DefaultPluginManager::clearCachedDefinitions()
ComponentPluginManager::clearCachedDefinitions in core/lib/Drupal/Core/Theme/ComponentPluginManager.php
ElementInfoManager::clearCachedDefinitions in core/lib/Drupal/Core/Render/ElementInfoManager.php
EntityTypeManager::clearCachedDefinitions in core/lib/Drupal/Core/Entity/EntityTypeManager.php
TypedDataManager::clearCachedDefinitions in core/lib/Drupal/Core/TypedData/TypedDataManager.php
11 methods override DefaultPluginManager::clearCachedDefinitions()
BreakpointManager::clearCachedDefinitions in core/modules/breakpoint/src/BreakpointManager.php
Clears static and persistent plugin definition caches.
ComponentPluginManager::clearCachedDefinitions in core/lib/Drupal/Core/Theme/ComponentPluginManager.php
ComponentPluginManager::clearCachedDefinitions in core/modules/sdc/src/ComponentPluginManager.php
Clears static and persistent plugin definition caches.
ConfigMapperManager::clearCachedDefinitions in core/modules/config_translation/src/ConfigMapperManager.php
Clears static and persistent plugin definition caches.
ContextualLinkManager::clearCachedDefinitions in core/lib/Drupal/Core/Menu/ContextualLinkManager.php

... See full list

File

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

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);
        }
    }
    if ($this->discovery instanceof CachedDiscoveryInterface) {
        $this->discovery
            ->clearCachedDefinitions();
    }
    $this->definitions = NULL;
}

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