You are here

protected function SitewideAlertRevisionRevertForm::prepareRevertedRevision in Sitewide Alert 8

Prepares a revision to be reverted.

Parameters

\Drupal\sitewide_alert\Entity\SitewideAlertInterface $revision: The revision to be reverted.

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

Return value

\Drupal\sitewide_alert\Entity\SitewideAlertInterface The prepared revision ready to be stored.

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

File

src/Form/SitewideAlertRevisionRevertForm.php, line 145

Class

SitewideAlertRevisionRevertForm
Provides a form for reverting a Sitewide Alert revision.

Namespace

Drupal\sitewide_alert\Form

Code

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