You are here

protected function SimpleMegaMenuRevisionRevertForm::prepareRevertedRevision in Simple Mega Menu 8

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

Prepares a revision to be reverted.

Parameters

\Drupal\simple_megamenu\Entity\SimpleMegaMenuInterface $revision: The revision to be reverted.

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

Return value

\Drupal\simple_megamenu\Entity\SimpleMegaMenuInterface The prepared revision ready to be stored.

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

File

src/Form/SimpleMegaMenuRevisionRevertForm.php, line 152

Class

SimpleMegaMenuRevisionRevertForm
Provides a form for reverting a Simple mega menu revision.

Namespace

Drupal\simple_megamenu\Form

Code

protected function prepareRevertedRevision(SimpleMegaMenuInterface $revision, FormStateInterface $form_state) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setRevisionCreationTime($this->time
    ->getRequestTime());
  return $revision;
}