function EventSubscriber::onConfigDelete

Same name in other branches
  1. 9 core/modules/config/tests/config_import_test/src/EventSubscriber.php \Drupal\config_import_test\EventSubscriber::onConfigDelete()
  2. 10 core/modules/config/tests/config_import_test/src/EventSubscriber.php \Drupal\config_import_test\EventSubscriber::onConfigDelete()
  3. 11.x 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);
    }
}

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