function Color::import

Same name in other branches
  1. 9 core/modules/color/src/Plugin/migrate/destination/Color.php \Drupal\color\Plugin\migrate\destination\Color::import()

Overrides MigrateDestinationInterface::import

File

core/modules/color/src/Plugin/migrate/destination/Color.php, line 63

Class

Color
Persist color data to the config system.

Namespace

Drupal\color\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {
    $imported = FALSE;
    $value = $row->getDestinationProperty('value');
    if (isset($value)) {
        $this->configFactory
            ->getEditable($row->getDestinationProperty('configuration_name'))
            ->set($row->getDestinationProperty('element_name'), $row->getDestinationProperty('value'))
            ->save();
        $imported = TRUE;
    }
    return $imported;
}

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