You are here

protected function NodeRevisionRevertDefaultForm::prepareRevertedRevision in Thunder 6.0.x

Same name and namespace in other branches
  1. 8.5 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
  2. 8.2 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
  3. 8.3 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
  4. 8.4 modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
  5. 6.2.x modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()
  6. 6.1.x modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php \Drupal\thunder_article\Form\NodeRevisionRevertDefaultForm::prepareRevertedRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\node\NodeInterface $revision: The revision to be reverted.

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

Return value

\Drupal\node\NodeInterface The prepared revision ready to be stored.

Overrides NodeRevisionRevertForm::prepareRevertedRevision

1 call to NodeRevisionRevertDefaultForm::prepareRevertedRevision()
NodeRevisionRevertDefaultForm::submitForm in modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php
Form submission handler.

File

modules/thunder_article/src/Form/NodeRevisionRevertDefaultForm.php, line 83

Class

NodeRevisionRevertDefaultForm
Provides a form for reverting a node revision.

Namespace

Drupal\thunder_article\Form

Code

protected function prepareRevertedRevision(NodeInterface $revision, FormStateInterface $form_state) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setRevisionTranslationAffected(TRUE);
  return $revision;
}