You are here

protected function Migration::findMigrationDependencies in Drupal 8

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

Find migration dependencies from migration_lookup and sub_process plugins.

Parameters

array $process: A process configuration array.

Return value

array The migration dependencies.

1 call to Migration::findMigrationDependencies()
Migration::getMigrationDependencies in core/modules/migrate/src/Plugin/Migration.php
Get the dependencies for this migration.

File

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

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

protected function findMigrationDependencies($process) {
  $return = [];
  foreach ($this
    ->getProcessNormalized($process) as $process_pipeline) {
    foreach ($process_pipeline as $plugin_configuration) {
      if (in_array($plugin_configuration['plugin'], [
        'migration',
        'migration_lookup',
      ], TRUE)) {
        $return = array_merge($return, (array) $plugin_configuration['migration']);
      }
      if (in_array($plugin_configuration['plugin'], [
        'iterator',
        'sub_process',
      ], TRUE)) {
        $return = array_merge($return, $this
          ->findMigrationDependencies($plugin_configuration['process']));
      }
    }
  }
  return $return;
}