public function MigrationController::process in Migrate Tools 8.2
Same name and namespace in other branches
- 8.5 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::process()
- 8.3 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::process()
- 8.4 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::process()
Display process information of a migration entity.
Parameters
string $migration_group: Machine name of the migration's group.
string $migration: Machine name of the migration.
Return value
array A render array as expected by drupal_render().
1 string reference to 'MigrationController::process'
File
- src/
Controller/ MigrationController.php, line 159
Class
- MigrationController
- Returns responses for migrate_tools migration view routes.
Namespace
Drupal\migrate_tools\ControllerCode
public function process($migration_group, $migration) {
/** @var MigrationInterface $migration */
$migration = $this->migrationConfigEntityPluginManager
->createInstance($migration);
// Process information.
$build['process'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Process'),
];
$header = [
$this
->t('Destination'),
$this
->t('Source'),
$this
->t('Process plugin'),
$this
->t('Default'),
];
$rows = [];
foreach ($migration
->getProcess() as $destination_id => $process_line) {
$row = [];
$row[] = [
'data' => Html::escape($destination_id),
];
if (isset($process_line[0]['source'])) {
$row[] = [
'data' => Xss::filterAdmin($process_line[0]['source']),
];
}
else {
$row[] = '';
}
if (isset($process_line[0]['plugin'])) {
$row[] = [
'data' => Xss::filterAdmin($process_line[0]['plugin']),
];
}
else {
$row[] = '';
}
if (isset($process_line[0]['default_value'])) {
$row[] = [
'data' => Xss::filterAdmin($process_line[0]['default_value']),
];
}
else {
$row[] = '';
}
$rows[] = $row;
}
$build['process']['fields'] = [
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => $this
->t('No process defined.'),
];
return $build;
}