You are here

protected function EventRevisionRevertForm::prepareRevertedRevision in Event 8

Prepares a revision to be reverted.

Parameters

\Drupal\event\Entity\EventInterface $revision: The revision to be reverted.

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

Return value

\Drupal\event\Entity\EventInterface The prepared revision ready to be stored.

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

File

src/Form/EventRevisionRevertForm.php, line 142

Class

EventRevisionRevertForm
Provides a form for reverting a Event revision.

Namespace

Drupal\event\Form

Code

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