You are here

public function ElementInfoManager::clearCachedDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::clearCachedDefinitions()
  2. 10 core/lib/Drupal/Core/Render/ElementInfoManager.php \Drupal\Core\Render\ElementInfoManager::clearCachedDefinitions()

Clears static and persistent plugin definition caches.

Don't resort to calling \Drupal::cache()->delete() and friends to make Drupal detect new or updated plugin definitions. Always use this method on the appropriate plugin type's plugin manager!

Overrides DefaultPluginManager::clearCachedDefinitions

File

core/lib/Drupal/Core/Render/ElementInfoManager.php, line 147

Class

ElementInfoManager
Provides a plugin manager for element plugins.

Namespace

Drupal\Core\Render

Code

public function clearCachedDefinitions() {
  $this->elementInfo = NULL;
  $this->cacheTagInvalidator
    ->invalidateTags([
    'element_info_build',
  ]);
  parent::clearCachedDefinitions();
}