public function CandidateNodesRevisionsDeleteForm::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/ CandidateNodesRevisionsDeleteForm.php, line 117
Class
- CandidateNodesRevisionsDeleteForm
- Provides a candidate node revision deletion confirmation form.
Namespace
Drupal\node_revision_delete\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Getting the content type candidate revisions.
$candidate_revisions = $this->nodeRevisionDelete
->getCandidatesRevisionsByNids([
$this->node
->id(),
]);
// Add the batch.
batch_set($this->nodeRevisionDelete
->getRevisionDeletionBatch($candidate_revisions, FALSE));
// Redirecting.
$form_state
->setRedirectUrl($this
->getCancelUrl());
}