You are here

public function Migration::getMigrationDependencies in Drupal 10

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

Get the dependencies for this migration.

Return value

array The dependencies for this migrations.

Overrides MigrationInterface::getMigrationDependencies

File

core/modules/migrate/src/Plugin/Migration.php, line 686

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function getMigrationDependencies() {
  $this->migration_dependencies = ($this->migration_dependencies ?: []) + [
    'required' => [],
    'optional' => [],
  ];
  if (count($this->migration_dependencies) !== 2 || !is_array($this->migration_dependencies['required']) || !is_array($this->migration_dependencies['optional'])) {
    throw new InvalidPluginDefinitionException($this
      ->id(), "Invalid migration dependencies configuration for migration {$this->id()}");
  }
  $this->migration_dependencies['optional'] = array_unique(array_merge($this->migration_dependencies['optional'], $this
    ->findMigrationDependencies($this->process)));
  return $this->migration_dependencies;
}