You are here

protected function MigrationState::getDestinationsForSource in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/MigrationState.php \Drupal\migrate_drupal\MigrationState::getDestinationsForSource()
  2. 10 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.

2 calls to MigrationState::getDestinationsForSource()
MigrationState::buildUpgradeState in core/modules/migrate_drupal/src/MigrationState.php
Determines migration state for each source module enabled on the source.
MigrationState::getSourceState in core/modules/migrate_drupal/src/MigrationState.php
Tests if a destination exists for the given source module.

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];
}