You are here

protected function EasyEmailRevisionRevertForm::prepareRevertedRevision in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/Form/EasyEmailRevisionRevertForm.php \Drupal\easy_email\Form\EasyEmailRevisionRevertForm::prepareRevertedRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\easy_email\Entity\EasyEmailInterface $revision: The revision to be reverted.

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

Return value

\Drupal\easy_email\Entity\EasyEmailInterface The prepared revision ready to be stored.

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

File

src/Form/EasyEmailRevisionRevertForm.php, line 141

Class

EasyEmailRevisionRevertForm
Provides a form for reverting a Email revision.

Namespace

Drupal\easy_email\Form

Code

protected function prepareRevertedRevision(EasyEmailInterface $revision, FormStateInterface $form_state) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setRevisionCreationTime(\Drupal::time()
    ->getRequestTime());
  return $revision;
}