You are here

protected function MigrationPluginManager::addDependency in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/MigrationPluginManager.php \Drupal\migrate\Plugin\MigrationPluginManager::addDependency()
  2. 10 core/modules/migrate/src/Plugin/MigrationPluginManager.php \Drupal\migrate\Plugin\MigrationPluginManager::addDependency()

Add one or more dependencies to a graph.

Parameters

array $graph: The graph so far, passed by reference.

int $id: The migration ID.

string $dependency: The dependency string.

array $dynamic_ids: The dynamic ID mapping.

1 call to MigrationPluginManager::addDependency()
MigrationPluginManager::buildDependencyMigration in core/modules/migrate/src/Plugin/MigrationPluginManager.php
Builds a dependency tree for the migrations and set their order.

File

core/modules/migrate/src/Plugin/MigrationPluginManager.php, line 228

Class

MigrationPluginManager
Plugin manager for migration plugins.

Namespace

Drupal\migrate\Plugin

Code

protected function addDependency(array &$graph, $id, $dependency, $dynamic_ids) {
  $dependencies = isset($dynamic_ids[$dependency]) ? $dynamic_ids[$dependency] : [
    $dependency,
  ];
  if (!isset($graph[$id]['edges'])) {
    $graph[$id]['edges'] = [];
  }
  $graph[$id]['edges'] += array_combine($dependencies, $dependencies);
}