You are here

protected function MigrateUpgradeDrushRunner::substituteIds in Migrate Upgrade 8.3

Same name and namespace in other branches
  1. 8.2 src/MigrateUpgradeDrushRunner.php \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner::substituteIds()

Rewrite any migration plugin IDs so they won't conflict with the core IDs.

Parameters

array $entity_array: A configuration array for a migration.

Return value

array The migration configuration array modified with new IDs.

2 calls to MigrateUpgradeDrushRunner::substituteIds()
MigrateUpgradeDrushRunner::export in src/MigrateUpgradeDrushRunner.php
Export the configured migration plugins as configuration entities.
TestMigrateUpgradeDrushRunner::substituteIds in tests/src/Unit/MigrateUpgradeDrushRunnerTest.php
Rewrite any migration plugin IDs so they won't conflict with the core IDs.
1 method overrides MigrateUpgradeDrushRunner::substituteIds()
TestMigrateUpgradeDrushRunner::substituteIds in tests/src/Unit/MigrateUpgradeDrushRunnerTest.php
Rewrite any migration plugin IDs so they won't conflict with the core IDs.

File

src/MigrateUpgradeDrushRunner.php, line 355

Class

MigrateUpgradeDrushRunner
Class MigrateUpgradeDrushRunner.

Namespace

Drupal\migrate_upgrade

Code

protected function substituteIds(array $entity_array) {
  $entity_array['id'] = $this
    ->modifyId($entity_array['id']);
  foreach ($entity_array['migration_dependencies'] as $type => $dependencies) {
    $new_dependencies = [];
    foreach ($dependencies as $dependency) {
      $new_dependencies = array_merge($new_dependencies, array_map([
        $this,
        'modifyId',
      ], $this
        ->expandPluginIds([
        $dependency,
      ])));
    }
    $entity_array['migration_dependencies'][$type] = $new_dependencies;
  }
  $this
    ->substituteMigrationIds($entity_array['process']);
  return $entity_array;
}