You are here

protected function MultiversionMigration::executeMigration in Multiversion 8

Helper method for running a migration.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration:

Return value

\Drupal\migrate\MigrateExecutableInterface

2 calls to MultiversionMigration::executeMigration()
MultiversionMigration::migrateContentFromTemp in src/MultiversionMigration.php
MultiversionMigration::migrateContentToTemp in src/MultiversionMigration.php

File

src/MultiversionMigration.php, line 258

Class

MultiversionMigration

Namespace

Drupal\multiversion

Code

protected function executeMigration(MigrationInterface $migration) {

  // Add necessary database connection that the Migrate API needs during
  // a migration like this.
  $connection_info = Database::getConnectionInfo('default');
  foreach ($connection_info as $target => $value) {
    $connection_info[$target]['prefix'] = [
      'default' => $value['prefix']['default'],
    ];
  }
  Database::addConnectionInfo('migrate', 'default', $connection_info['default']);
  $message = new MigrateMessage();
  $executable = new MigrateExecutable($migration, $message);
  $executable
    ->import();
  return $executable;
}