public function DeleteForm::submitForm

Same name in this branch

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides FormInterface::submitForm

File

drupal/core/modules/contact/lib/Drupal/contact/Form/DeleteForm.php, line 65
Contains \Drupal\contact\Form\DeleteForm.

Class

DeleteForm
Builds the form to delete a contact category.

Namespace

Drupal\contact\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $this->contactCategory
    ->delete();
  drupal_set_message(t('Category %label has been deleted.', array(
    '%label' => $this->contactCategory
      ->label(),
  )));
  watchdog('contact', 'Category %label has been deleted.', array(
    '%label' => $this->contactCategory
      ->label(),
  ), WATCHDOG_NOTICE);
  $form_state['redirect'] = 'admin/structure/contact';
}