You are here

public function FileDeleteMultipleForm::submitForm in File Entity (fieldable files) 8.2

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/FileDeleteMultipleForm.php, line 120

Class

FileDeleteMultipleForm
Provides a file deletion confirmation form.

Namespace

Drupal\file_entity\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('confirm') && !empty($this->files)) {
    $this->storage
      ->delete($this->files);
    $this->tempStore
      ->delete('delete');
  }
  $form_state
    ->setRedirect('entity.file.collection');
}