You are here

public function ConfigFactory::onConfigDelete in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::onConfigDelete()

Removes stale static cache entries when configuration is deleted.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.

File

core/lib/Drupal/Core/Config/ConfigFactory.php, line 363
Contains \Drupal\Core\Config\ConfigFactory.

Class

ConfigFactory
Defines the configuration object factory.

Namespace

Drupal\Core\Config

Code

public function onConfigDelete(ConfigCrudEvent $event) {

  // Ensure that the static cache does not contain deleted configuration.
  foreach ($this
    ->getConfigCacheKeys($event
    ->getConfig()
    ->getName()) as $cache_key) {
    unset($this->cache[$cache_key]);
  }
}