You are here

protected function MigrateUpgradeDrushRunner::prefixFileMigration in Migrate Upgrade 8.3

For D6 file fields, make sure the d6_file migration is prefixed.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: Migration to alter.

1 call to MigrateUpgradeDrushRunner::prefixFileMigration()
MigrateUpgradeDrushRunner::configure in src/MigrateUpgradeDrushRunner.php
From the provided source information, configure the appropriate migrations.

File

src/MigrateUpgradeDrushRunner.php, line 206

Class

MigrateUpgradeDrushRunner
Class MigrateUpgradeDrushRunner.

Namespace

Drupal\migrate_upgrade

Code

protected function prefixFileMigration(MigrationInterface $migration) {
  $process = $migration
    ->getProcess();
  foreach ($process as $destination => &$plugins) {
    foreach ($plugins as &$plugin) {
      if ($plugin['plugin'] === 'd6_field_file') {
        $file_migration = isset($plugin['migration']) ? $plugin['migration'] : 'd6_file';
        $plugin['migration'] = $this
          ->modifyId($file_migration);
      }
    }
  }
}