function EventSubscriber::configEventRecorder

Same name in other branches
  1. 8.9.x core/modules/config/tests/config_events_test/src/EventSubscriber.php \Drupal\config_events_test\EventSubscriber::configEventRecorder()
  2. 10 core/modules/language/tests/language_events_test/src/EventSubscriber.php \Drupal\language_events_test\EventSubscriber::configEventRecorder()
  3. 10 core/modules/config/tests/config_events_test/src/EventSubscriber.php \Drupal\config_events_test\EventSubscriber::configEventRecorder()
  4. 11.x core/modules/language/tests/language_events_test/src/EventSubscriber.php \Drupal\language_events_test\EventSubscriber::configEventRecorder()
  5. 11.x core/modules/config/tests/config_events_test/src/EventSubscriber.php \Drupal\config_events_test\EventSubscriber::configEventRecorder()

Reacts to config event.

Parameters

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

string $name: The event name.

File

core/modules/config/tests/config_events_test/src/EventSubscriber.php, line 37

Class

EventSubscriber

Namespace

Drupal\config_events_test

Code

public function configEventRecorder(ConfigCrudEvent $event, $name) {
    $config = $event->getConfig();
    $this->state
        ->set('config_events_test.event', [
        'event_name' => $name,
        'current_config_data' => $config->get(),
        'original_config_data' => $config->getOriginal(),
        'raw_config_data' => $config->getRawData(),
    ]);
}

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