You are here

public function Config::import in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config::import()

Import the row.

Derived classes must implement import(), to construct one new object (pre-populated) using ID mappings in the Migration.

Parameters

\Drupal\migrate\Row $row: The row object.

array $old_destination_id_values: The old destination ids.

Return value

mixed The entity id or an indication of success.

Overrides MigrateDestinationInterface::import

File

core/modules/migrate/src/Plugin/migrate/destination/Config.php, line 75
Contains \Drupal\migrate\Plugin\migrate\destination\Config.

Class

Config
Persist data to the config system.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = array()) {
  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();
  return [
    $this->config
      ->getName(),
  ];
}