You are here

protected function HeartbeatRevisionRevertForm::prepareRevertedRevision in Heartbeat 8

Prepares a revision to be reverted.

Parameters

\Drupal\heartbeat\Entity\HeartbeatInterface $revision: The revision to be reverted.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

\Drupal\heartbeat\Entity\HeartbeatInterface The prepared revision ready to be stored.

1 call to HeartbeatRevisionRevertForm::prepareRevertedRevision()
HeartbeatRevisionRevertForm::submitForm in src/Form/HeartbeatRevisionRevertForm.php
Form submission handler.
1 method overrides HeartbeatRevisionRevertForm::prepareRevertedRevision()
HeartbeatRevisionRevertTranslationForm::prepareRevertedRevision in src/Form/HeartbeatRevisionRevertTranslationForm.php
Prepares a revision to be reverted.

File

src/Form/HeartbeatRevisionRevertForm.php, line 141

Class

HeartbeatRevisionRevertForm
Provides a form for reverting a Heartbeat revision.

Namespace

Drupal\heartbeat\Form

Code

protected function prepareRevertedRevision(HeartbeatInterface $revision, FormStateInterface $form_state) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setRevisionCreationTime(REQUEST_TIME);
  return $revision;
}