You are here

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

Prepares a revision to be reverted.

Parameters

\Drupal\pm_organization\Entity\OrganizationInterface $revision: The revision to be reverted.

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

Return value

\Drupal\pm_organization\Entity\OrganizationInterface The prepared revision ready to be stored.

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

File

modules/pm_organization/src/Form/OrganizationRevisionRevertForm.php, line 147

Class

OrganizationRevisionRevertForm
Provides a form for reverting a Organization revision.

Namespace

Drupal\pm_organization\Form

Code

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