You are here

protected function ScheduleRevisionRevertForm::prepareRevertedRevision in Business Rules 2.x

Same name and namespace in other branches
  1. 8 src/Form/ScheduleRevisionRevertForm.php \Drupal\business_rules\Form\ScheduleRevisionRevertForm::prepareRevertedRevision()

Prepares a revision to be reverted.

Parameters

\Drupal\business_rules\Entity\ScheduleInterface $revision: The revision to be reverted.

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

Return value

\Drupal\business_rules\Entity\ScheduleInterface The prepared revision ready to be stored.

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

File

src/Form/ScheduleRevisionRevertForm.php, line 141

Class

ScheduleRevisionRevertForm
Provides a form for reverting a Schedule revision.

Namespace

Drupal\business_rules\Form

Code

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