You are here

protected function HeartbeatStreamRevisionRevertForm::prepareRevertedRevision in Heartbeat 8

Prepares a revision to be reverted.

Parameters

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

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

Return value

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

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

File

src/Form/HeartbeatStreamRevisionRevertForm.php, line 141

Class

HeartbeatStreamRevisionRevertForm
Provides a form for reverting a Heartbeat stream revision.

Namespace

Drupal\heartbeat\Form

Code

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