You are here

protected function RevisionRevertForm::prepareRevision in Entity API 8

Same name and namespace in other branches
  1. 8.0 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 153

Class

RevisionRevertForm

Namespace

Drupal\entity\Form

Code

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