You are here

public function MigrationDeleteForm::submitForm in Migrate Tools 8

Same name and namespace in other branches
  1. 8.5 src/Form/MigrationDeleteForm.php \Drupal\migrate_tools\Form\MigrationDeleteForm::submitForm()
  2. 8.2 src/Form/MigrationDeleteForm.php \Drupal\migrate_tools\Form\MigrationDeleteForm::submitForm()
  3. 8.3 src/Form/MigrationDeleteForm.php \Drupal\migrate_tools\Form\MigrationDeleteForm::submitForm()
  4. 8.4 src/Form/MigrationDeleteForm.php \Drupal\migrate_tools\Form\MigrationDeleteForm::submitForm()

The submit handler for the confirm form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: An associative array containing the current state of the form.

Overrides EntityForm::submitForm

File

src/Form/MigrationDeleteForm.php, line 63
Contains Drupal\migrate_tools\Form\MigrationDeleteForm.

Class

MigrationDeleteForm
Class MigrationDeleteForm.

Namespace

Drupal\migrate_tools\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Delete the entity.
  $this->entity
    ->delete();

  // Set a message that the entity was deleted.
  drupal_set_message(t('Migration %label was deleted.', array(
    '%label' => $this->entity
      ->label(),
  )));

  // Redirect the user to the list controller when complete.
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl(), array(
    'migration_group' => $this->entity
      ->get('migration_group'),
  ));
}