You are here

protected function HomeboxLayoutRevisionRevertForm::prepareRevertedRevision in Homebox 8

Prepares a revision to be reverted.

Parameters

\Drupal\homebox\Entity\HomeboxLayoutInterface $revision: The revision to be reverted.

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

Return value

\Drupal\homebox\Entity\HomeboxLayoutInterface The prepared revision ready to be stored.

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

File

src/Form/HomeboxLayoutRevisionRevertForm.php, line 159

Class

HomeboxLayoutRevisionRevertForm
Provides a form for reverting a Homebox Layout revision.

Namespace

Drupal\homebox\Form

Code

protected function prepareRevertedRevision(HomeboxLayoutInterface $revision, FormStateInterface $form_state) {
  $revision
    ->setNewRevision();
  $revision
    ->isDefaultRevision(TRUE);
  $revision
    ->setRevisionCreationTime($this->time
    ->getRequestTime());
  return $revision;
}