NodeRevisionRevertForm::prepareRevertedRevision

protected NodeRevisionRevertForm::prepareRevertedRevision(NodeInterface $revision, FormStateInterface $form_state)

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.

File

core/modules/node/src/Form/NodeRevisionRevertForm.php, line 138

Class

NodeRevisionRevertForm
Provides a form for reverting a node revision.

Namespace

Drupal\node\Form

Code

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

  return $revision;
}
doc_Drupal
2016-10-29 09:31:09
Comments
Leave a Comment

Please login to continue.