You are here

public function ContentTypeRevisionsDeleteForm::submitForm in Node Revision Delete 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/ContentTypeRevisionsDeleteForm.php, line 105

Class

ContentTypeRevisionsDeleteForm
Provides a content type revision deletion confirmation form.

Namespace

Drupal\node_revision_delete\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Getting the content type candidate revisions.
  $candidate_revisions = $this->nodeRevisionDelete
    ->getCandidatesRevisions($this->contentType
    ->id());

  // Add the batch.
  batch_set($this->nodeRevisionDelete
    ->getRevisionDeletionBatch($candidate_revisions, FALSE));

  // Redirecting.
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}