protected function OpignoAnswerRevisionRevertForm::prepareRevertedRevision in Opigno module 8
Same name and namespace in other branches
- 3.x src/Form/OpignoAnswerRevisionRevertForm.php \Drupal\opigno_module\Form\OpignoAnswerRevisionRevertForm::prepareRevertedRevision()
Prepares a revision to be reverted.
Parameters
\Drupal\opigno_module\Entity\OpignoAnswerInterface $revision: The revision to be reverted.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
\Drupal\opigno_module\Entity\OpignoAnswerInterface The prepared revision ready to be stored.
1 call to OpignoAnswerRevisionRevertForm::prepareRevertedRevision()
- OpignoAnswerRevisionRevertForm::submitForm in src/
Form/ OpignoAnswerRevisionRevertForm.php - Form submission handler.
1 method overrides OpignoAnswerRevisionRevertForm::prepareRevertedRevision()
- OpignoAnswerRevisionRevertTranslationForm::prepareRevertedRevision in src/
Form/ OpignoAnswerRevisionRevertTranslationForm.php - Prepares a revision to be reverted.
File
- src/
Form/ OpignoAnswerRevisionRevertForm.php, line 141
Class
- OpignoAnswerRevisionRevertForm
- Provides a form for reverting a Answer revision.
Namespace
Drupal\opigno_module\FormCode
protected function prepareRevertedRevision(OpignoAnswerInterface $revision, FormStateInterface $form_state) {
$revision
->setNewRevision();
$revision
->isDefaultRevision(TRUE);
$revision
->setRevisionCreationTime(\Drupal::time()
->getRequestTime());
return $revision;
}