public function MigrationController::run in Migrate Tools 8.4
Same name and namespace in other branches
- 8.5 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::run()
Run a migration.
Parameters
\Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group: The migration group.
\Drupal\migrate_plus\Entity\MigrationInterface $migration: The $migration.
Return value
array A render array as expected by drupal_render().
1 string reference to 'MigrationController::run'
File
- src/
Controller/ MigrationController.php, line 167
Class
- MigrationController
- Returns responses for migrate_tools migration view routes.
Namespace
Drupal\migrate_tools\ControllerCode
public function run(MigrationGroupInterface $migration_group, MigrationInterface $migration) {
$migrateMessage = new MigrateMessage();
$options = [];
$migration_plugin = $this->migrationPluginManager
->createInstance($migration
->id(), $migration
->toArray());
$executable = new MigrateBatchExecutable($migration_plugin, $migrateMessage, $options);
$executable
->batchImport();
$migration_group = $this->currentRouteMatch
->getParameter('migration_group');
$route_parameters = [
'migration_group' => $migration_group,
'migration' => $migration
->id(),
];
return batch_process(Url::fromRoute('entity.migration.process', $route_parameters));
}