You are here

protected function MigrationExecuteForm::buildFormOperations in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8.4 src/Form/MigrationExecuteForm.php \Drupal\migrate_tools\Form\MigrationExecuteForm::buildFormOperations()

Build the operation form field.

Parameters

array $form: The execution form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array The execution form updated with the operations.

1 call to MigrationExecuteForm::buildFormOperations()
MigrationExecuteForm::buildForm in src/Form/MigrationExecuteForm.php
Form constructor.

File

src/Form/MigrationExecuteForm.php, line 88

Class

MigrationExecuteForm
This form is specifically for configuring process pipelines.

Namespace

Drupal\migrate_tools\Form

Code

protected function buildFormOperations(array $form, FormStateInterface $form_state) {

  // Build the migration execution form.
  $options = [
    'import' => $this
      ->t('Import'),
    'rollback' => $this
      ->t('Rollback'),
    'stop' => $this
      ->t('Stop'),
    'reset' => $this
      ->t('Reset'),
  ];
  $form['operation'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Operation'),
    '#description' => $this
      ->t('Choose an operation to run.'),
    '#options' => $options,
    '#default_value' => 'import',
    '#required' => TRUE,
    'import' => [
      '#description' => $this
        ->t('Imports all previously unprocessed records from the source, plus any records marked for update, into destination Drupal objects.'),
    ],
    'rollback' => [
      '#description' => $this
        ->t('Deletes all Drupal objects created by the import.'),
    ],
    'stop' => [
      '#description' => $this
        ->t('Cleanly interrupts any import or rollback processes that may currently be running.'),
    ],
    'reset' => [
      '#description' => $this
        ->t('Sometimes a process may fail to stop cleanly, and be left stuck in an Importing or Rolling Back status. Choose Reset to clear the status and permit other operations to proceed.'),
    ],
  ];
  return $form;
}