protected function ConfigImporter::importConfig

Writes an array of config changes from the source to the target storage.

1 call to ConfigImporter::importConfig()
ConfigImporter::import in drupal/core/lib/Drupal/Core/Config/ConfigImporter.php
Imports the changelist to the target storage.

File

drupal/core/lib/Drupal/Core/Config/ConfigImporter.php, line 253
Contains \Drupal\Core\Config\ConfigImporter.

Class

ConfigImporter
Defines a configuration importer.

Namespace

Drupal\Core\Config

Code

protected function importConfig() {
  foreach (array(
    'delete',
    'create',
    'update',
  ) as $op) {
    foreach ($this
      ->getUnprocessed($op) as $name) {
      $config = new Config($name, $this->storageComparer
        ->getTargetStorage(), $this->context);
      if ($op == 'delete') {
        $config
          ->delete();
      }
      else {
        $data = $this->storageComparer
          ->getSourceStorage()
          ->read($name);
        $config
          ->setData($data ? $data : array());
        $config
          ->save();
      }
      $this
        ->setProcessed($op, $name);
    }
  }
}