You are here

public function CustomFilterForm::delete in Custom filter 8

Same name and namespace in other branches
  1. 2.0.x src/Form/CustomFilterForm.php \Drupal\customfilter\Form\CustomFilterForm::delete()

File

src/Form/CustomFilterForm.php, line 103

Class

CustomFilterForm

Namespace

Drupal\customfilter\Form

Code

public function delete(array $form, FormStateInterface $form_state) {
  $destination = array();
  $request = $this
    ->getRequest();
  if ($request->query
    ->has('destination')) {
    $destination = drupal_get_destination();
    $request->query
      ->remove('destination');
  }
  $form_state
    ->setRedirect('entity.customfilter.delete_form', array(
    $this->entity
      ->id(),
  ), array(
    'query' => $destination,
  ));
}