function ThemeSettings::import

Same name and namespace in other branches
  1. 11.x core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php \Drupal\system\Plugin\migrate\destination\d7\ThemeSettings::import()
  2. 10 core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php \Drupal\system\Plugin\migrate\destination\d7\ThemeSettings::import()
  3. 8.9.x core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php \Drupal\system\Plugin\migrate\destination\d7\ThemeSettings::import()

File

core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php, line 63

Class

ThemeSettings
Persist theme settings to the config system.

Namespace

Drupal\system\Plugin\migrate\destination\d7

Code

public function import(Row $row, array $old_destination_id_values = []) {
  $imported = FALSE;
  $config = $this->configFactory
    ->getEditable($row->getDestinationProperty('configuration_name'));
  $theme_settings = $row->getDestination();
  // Remove keys not in theme settings.
  unset($theme_settings['configuration_name']);
  unset($theme_settings['theme_name']);
  unset($theme_settings['legacy_theme_name']);
  if (isset($theme_settings)) {
    theme_settings_convert_to_config($theme_settings, $config);
    $config->save();
    $imported = TRUE;
  }
  return $imported;
}

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