You are here

protected function PetRevisionRevertForm::prepareRevertedRevision in Previewable email templates 8.3

Prepares a revision to be reverted.

Parameters

\Drupal\pet\Entity\PetInterface $revision: The revision to be reverted.

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

Return value

\Drupal\pet\Entity\PetInterface The prepared revision ready to be stored.

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

File

src/Form/PetRevisionRevertForm.php, line 141

Class

PetRevisionRevertForm
Provides a form for reverting a Pet revision.

Namespace

Drupal\pet\Form

Code

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