You are here

protected function ProjectRevisionRevertForm::prepareRevertedRevision in Drupal PM (Project Management) 4.x

Prepares a revision to be reverted.

Parameters

\Drupal\pm_project\Entity\ProjectInterface $revision: The revision to be reverted.

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

Return value

\Drupal\pm_project\Entity\ProjectInterface The prepared revision ready to be stored.

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

File

modules/pm_project/src/Form/ProjectRevisionRevertForm.php, line 147

Class

ProjectRevisionRevertForm
Provides a form for reverting a Project revision.

Namespace

Drupal\pm_project\Form

Code

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