You are here

protected function FlaggingCollectionRevisionRevertForm::prepareRevertedRevision in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/Form/FlaggingCollectionRevisionRevertForm.php \Drupal\flag_lists\Form\FlaggingCollectionRevisionRevertForm::prepareRevertedRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\flag_lists\Entity\FlaggingCollectionInterface $revision: The revision to be reverted.

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

Return value

\Drupal\flag_lists\Entity\FlaggingCollectionInterface The prepared revision ready to be stored.

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

File

src/Form/FlaggingCollectionRevisionRevertForm.php, line 142

Class

FlaggingCollectionRevisionRevertForm
Provides a form for reverting a Flagging collection revision.

Namespace

Drupal\flag_lists\Form

Code

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