You are here

protected function OpignoActivityRevisionRevertForm::prepareRevertedRevision in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Form/OpignoActivityRevisionRevertForm.php \Drupal\opigno_module\Form\OpignoActivityRevisionRevertForm::prepareRevertedRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\opigno_module\Entity\OpignoActivityInterface $revision: The revision to be reverted.

Return value

\Drupal\opigno_module\Entity\OpignoActivityInterface The prepared revision ready to be stored.

1 call to OpignoActivityRevisionRevertForm::prepareRevertedRevision()
OpignoActivityRevisionRevertForm::submitForm in src/Form/OpignoActivityRevisionRevertForm.php
Form submission handler.

File

src/Form/OpignoActivityRevisionRevertForm.php, line 128

Class

OpignoActivityRevisionRevertForm
Provides a form for reverting a Answer revision.

Namespace

Drupal\opigno_module\Form

Code

protected function prepareRevertedRevision(OpignoActivityInterface $revision) : OpignoActivityInterface {
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setCreatedTime(\Drupal::time()
    ->getRequestTime());
  return $revision;
}