You are here

public function ConfigEventSubscriber::configSave in Tome 8

Reacts to a save event.

Parameters

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

File

modules/tome_sync/src/EventSubscriber/ConfigEventSubscriber.php, line 41

Class

ConfigEventSubscriber
Keeps the config export directory synced with config CRUD operations.

Namespace

Drupal\tome_sync\EventSubscriber

Code

public function configSave(ConfigCrudEvent $event) {
  if (!\Drupal::isConfigSyncing() && !isset($GLOBALS['_tome_sync_installing'])) {
    $config = $event
      ->getConfig();
    $this->configStorage
      ->write($config
      ->getName(), $config
      ->getRawData());
  }
}