You are here

public function EventSubscriber::configEventRecorder in Drupal 8

Same name and namespace in other branches
  1. 9 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(),
  ]);
}