You are here

public function DeleteFeedForm::submitForm in Feed Import 8

Form submission handler.

Parameters

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

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

Overrides FormInterface::submitForm

File

src/Form/DeleteFeedForm.php, line 69
Contains \Drupal\feed_import\Form\DeleteFeedForm

Class

DeleteFeedForm
Builds the form to delete a feed.

Namespace

Drupal\feed_import\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if (!$this->feed) {
    return;
  }
  FeedImport::deleteFeed($this->feed, (bool) $form_state
    ->getValue('hashes'));
  drupal_set_message(t('Feed deleted'));
  $form_state
    ->setRedirect('feed_import.admin');
}