You are here

public function LanguageConfigEventSubscriber::configSave in Tome 8

Reacts to a save event.

Parameters

\Drupal\language\Config\LanguageConfigOverrideCrudEvent $event: The configuration event.

File

modules/tome_sync/src/EventSubscriber/LanguageConfigEventSubscriber.php, line 40

Class

LanguageConfigEventSubscriber
Keeps the config export directory synced with language config operations.

Namespace

Drupal\tome_sync\EventSubscriber

Code

public function configSave(LanguageConfigOverrideCrudEvent $event) {
  if (!\Drupal::isConfigSyncing()) {
    $override = $event
      ->getLanguageConfigOverride();
    $collection = $this->configStorage
      ->createCollection($override
      ->getStorage()
      ->getCollectionName());
    $name = $override
      ->getName();
    $collection
      ->write($name, $override
      ->get());
  }
}