You are here

protected function RevisionRevertForm::prepareRevision in Entity API 8.0

Same name and namespace in other branches
  1. 8 src/Form/RevisionRevertForm.php \Drupal\entity\Form\RevisionRevertForm::prepareRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\Core\Entity\RevisionableInterface $revision: The revision to be reverted.

Return value

\Drupal\Core\Entity\RevisionableInterface The prepared revision ready to be stored.

1 call to RevisionRevertForm::prepareRevision()
RevisionRevertForm::submitForm in src/Form/RevisionRevertForm.php
Form submission handler.

File

src/Form/RevisionRevertForm.php, line 152
Contains \Drupal\entity\Form\RevisionRevertForm.

Class

RevisionRevertForm

Namespace

Drupal\entity\Form

Code

protected function prepareRevision(RevisionableInterface $revision) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  return $revision;
}