You are here

public function MigrationController::overview in Migrate Tools 8.2

Same name and namespace in other branches
  1. 8.5 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::overview()
  2. 8.3 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::overview()
  3. 8.4 src/Controller/MigrationController.php \Drupal\migrate_tools\Controller\MigrationController::overview()

Displays an overview 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::overview'
migrate_tools.routing.yml in ./migrate_tools.routing.yml
migrate_tools.routing.yml

File

src/Controller/MigrationController.php, line 55

Class

MigrationController
Returns responses for migrate_tools migration view routes.

Namespace

Drupal\migrate_tools\Controller

Code

public function overview($migration_group, $migration) {

  /** @var MigrationInterface $migration */
  $migration = $this->migrationConfigEntityPluginManager
    ->createInstance($migration);
  $build['overview'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Overview'),
  ];
  $build['overview']['group'] = [
    '#title' => $this
      ->t('Group:'),
    '#markup' => Xss::filterAdmin($migration_group),
    '#type' => 'item',
  ];
  $build['overview']['description'] = [
    '#title' => $this
      ->t('Description:'),
    '#markup' => Xss::filterAdmin($migration
      ->label()),
    '#type' => 'item',
  ];
  $migration_dependencies = $migration
    ->getMigrationDependencies();
  if (!empty($migration_dependencies['required'])) {
    $build['overview']['dependencies'] = [
      '#title' => $this
        ->t('Migration Dependencies'),
      '#markup' => Xss::filterAdmin(implode(', ', $migration_dependencies['required'])),
      '#type' => 'item',
    ];
  }
  if (!empty($migration_dependencies['optional'])) {
    $build['overview']['soft_dependencies'] = [
      '#title' => $this
        ->t('Soft Migration Dependencies'),
      '#markup' => Xss::filterAdmin(implode(', ', $migration_dependencies['optional'])),
      '#type' => 'item',
    ];
  }
  return $build;
}