You are here

public function Config::getDestinationModule in Drupal 10

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

Gets the destination module handling the destination data.

Return value

string|null The destination module or NULL if not found.

Overrides DestinationBase::getDestinationModule

File

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

Class

Config
Provides Configuration Management destination plugin.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function getDestinationModule() {
  if (!empty($this->configuration['destination_module'])) {
    return $this->configuration['destination_module'];
  }
  if (!empty($this->pluginDefinition['destination_module'])) {
    return $this->pluginDefinition['destination_module'];
  }

  // Config translations require the config_translation module so set the
  // migration provider to 'config_translation'. The corresponding non
  // translated configuration is expected to be handled in a separate
  // migration.
  if (isset($this->configuration['translations'])) {
    return 'config_translation';
  }

  // Get the module handling this configuration object from the config_name,
  // which is of the form <module_name>.<configuration object name>
  return !empty($this->configuration['config_name']) ? explode('.', $this->configuration['config_name'], 2)[0] : NULL;
}