function Migration::findMigrationDependencies

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::findMigrationDependencies()
  2. 10 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::findMigrationDependencies()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.