You are here

public function EventSubscriber::onConfigDelete in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config/tests/config_import_test/src/EventSubscriber.php \Drupal\config_import_test\EventSubscriber::onConfigDelete()

Reacts to a config delete and records information in state for testing.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event:

File

core/modules/config/tests/config_import_test/src/EventSubscriber.php, line 120

Class

EventSubscriber
Config import subscriber for config import events.

Namespace

Drupal\config_import_test

Code

public function onConfigDelete(ConfigCrudEvent $event) {
  $config = $event
    ->getConfig();
  if ($config
    ->getName() == 'automated_cron.settings') {
    $value = $this->state
      ->get('ConfigImportUITest.automated_cron.settings.delete', 0);
    $this->state
      ->set('ConfigImportUITest.automated_cron.settings.delete', $value + 1);
  }
}