You are here

public function ConfigImportEventSubscriber::onConfigImport in Config Ignore Keys 8

Saves the old configuration for the ignored config keys.

File

src/EventSubscriber/ConfigImportEventSubscriber.php, line 126

Class

ConfigImportEventSubscriber
Class ConfigImportEventSubscriber.

Namespace

Drupal\config_ignore_keys\EventSubscriber

Code

public function onConfigImport() {
  foreach ($this->plugins as $plugin) {
    foreach ($this->pluginManager
      ->createInstance($plugin['id'])
      ->getConfigurations() as $configFile => $keys) {
      if (is_array($keys)) {
        foreach ($keys as $configKey) {
          $this
            ->saveConfigFromState($configFile, $configKey);
        }
      }
      else {
        $this
          ->saveConfigFileFromState($configFile, $configFile);
      }
    }
  }
}