You are here

public function MigrationGroupDeleteForm::submitForm in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8 src/Form/MigrationGroupDeleteForm.php \Drupal\migrate_tools\Form\MigrationGroupDeleteForm::submitForm()
  2. 8.2 src/Form/MigrationGroupDeleteForm.php \Drupal\migrate_tools\Form\MigrationGroupDeleteForm::submitForm()
  3. 8.3 src/Form/MigrationGroupDeleteForm.php \Drupal\migrate_tools\Form\MigrationGroupDeleteForm::submitForm()
  4. 8.4 src/Form/MigrationGroupDeleteForm.php \Drupal\migrate_tools\Form\MigrationGroupDeleteForm::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/MigrationGroupDeleteForm.php, line 58

Class

MigrationGroupDeleteForm
Provides the delete form for our Migration Group entity.

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.
  $this
    ->messenger()
    ->addStatus($this
    ->t('Migration group %label was deleted.', [
    '%label' => $this->entity
      ->label(),
  ]));

  // Redirect the user to the list controller when complete.
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}