You are here

public function CandidateRevisionsContentTypeForm::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/CandidateRevisionsContentTypeForm.php, line 225

Class

CandidateRevisionsContentTypeForm
Class CandidateRevisionsContentTypeForm.

Namespace

Drupal\node_revision_delete\Form

Code

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

  // Get selected revisions.
  $candidate_revisions = array_filter($form_state
    ->getValue('candidate_revisions'));
  if (count($candidate_revisions)) {

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