public function OpignoActivityRevisionDeleteForm::submitForm in Opigno module 8
Same name and namespace in other branches
- 3.x src/Form/OpignoActivityRevisionDeleteForm.php \Drupal\opigno_module\Form\OpignoActivityRevisionDeleteForm::submitForm()
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/ OpignoActivityRevisionDeleteForm.php, line 107
Class
- OpignoActivityRevisionDeleteForm
- Provides a form for deleting a Answer revision.
Namespace
Drupal\opigno_module\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->opignoActivityStorage
->deleteRevision($this->revision
->getRevisionId());
$this
->logger('content')
->notice('Activity: deleted %title revision %revision.', [
'%title' => $this->entity
->label(),
'%revision' => $this->revision
->getRevisionId(),
]);
\Drupal::messenger()
->addMessage(t('Revision of Activity has been deleted.'));
$form_state
->setRedirect('entity.opigno_activity.version_history', [
'opigno_activity' => $this->entity
->id(),
]);
}