function Config::import

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config::import()
  2. 10 core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config::import()
  3. 11.x core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config::import()

Overrides MigrateDestinationInterface::import

1 method overrides Config::import()
DefaultLangcode::import in core/modules/language/src/Plugin/migrate/destination/DefaultLangcode.php
Import the row.

File

core/modules/migrate/src/Plugin/migrate/destination/Config.php, line 132

Class

Config
Provides Configuration Management destination plugin.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {
    if ($this->isTranslationDestination()) {
        $this->config = $this->language_manager
            ->getLanguageConfigOverride($row->getDestinationProperty('langcode'), $this->config
            ->getName());
    }
    foreach ($row->getRawDestination() as $key => $value) {
        if (isset($value) || !empty($this->configuration['store null'])) {
            $this->config
                ->set(str_replace(Row::PROPERTY_SEPARATOR, '.', $key), $value);
        }
    }
    $this->config
        ->save();
    $ids[] = $this->config
        ->getName();
    if ($this->isTranslationDestination()) {
        $ids[] = $row->getDestinationProperty('langcode');
    }
    return $ids;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.