You are here

public function QueueEmptyForm::emptyQueue in Purge 8.3

Empty the queue.

Parameters

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

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

Return value

\Drupal\Core\Ajax\AjaxResponse The AJAX response object.

File

modules/purge_ui/src/Form/QueueEmptyForm.php, line 118

Class

QueueEmptyForm
Empty the queue.

Namespace

Drupal\purge_ui\Form

Code

public function emptyQueue(array &$form, FormStateInterface $form_state) {
  $this->purgeQueue
    ->emptyQueue();
  $response = new AjaxResponse();
  $response
    ->addCommand(new CloseModalDialogCommand());
  return $response;
}