You are here

protected function MigrationState::getDestinationsForSource in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/MigrationState.php \Drupal\migrate_drupal\MigrationState::getDestinationsForSource()
  2. 9 core/modules/migrate_drupal/src/MigrationState.php \Drupal\migrate_drupal\MigrationState::getDestinationsForSource()

Get net destinations for source module.

Parameters

string $version: Source version.

string $source_module: Source module.

Return value

array Destination modules either declared by {modulename}.migrate_drupal.yml files or discovered from migration plugins.

File

core/modules/migrate_drupal/src/MigrationState.php, line 445

Class

MigrationState
Determines the migrate state for all modules enabled on the source.

Namespace

Drupal\migrate_drupal

Code

protected function getDestinationsForSource($version, $source_module) {
  if (!isset($this->destinations[$version][$source_module])) {
    $this->discoveredBySource[$version] += [
      $source_module => [],
    ];
    $this->declaredBySource[$version] += [
      $source_module => [],
    ];
    $destination = array_unique(array_merge($this->discoveredBySource[$version][$source_module], $this->declaredBySource[$version][$source_module]));
    sort($destination);
    $this->destinations[$version][$source_module] = $destination;
  }
  return $this->destinations[$version][$source_module];
}