You are here

public function ConfigEntityRevisionsRevertFormBase::displayUpdate in Config Entity Revisions 8.2

Same name and namespace in other branches
  1. 8 src/ConfigEntityRevisionsRevertFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsRevertFormBase::displayUpdate()
  2. 1.x src/ConfigEntityRevisionsRevertFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsRevertFormBase::displayUpdate()

Add a message to the page loaded next.

1 call to ConfigEntityRevisionsRevertFormBase::displayUpdate()
ConfigEntityRevisionsRevertFormBase::submitForm in src/ConfigEntityRevisionsRevertFormBase.php
Form submission handler.
1 method overrides ConfigEntityRevisionsRevertFormBase::displayUpdate()
ConfigEntityRevisionsRevertFormTest3::displayUpdate in tests/src/Unit/ConfigEntityRevisionsRevertFormBaseTest.php
Apply the revision insert/update.

File

src/ConfigEntityRevisionsRevertFormBase.php, line 278

Class

ConfigEntityRevisionsRevertFormBase
Class ConfigEntityRevisionsRevertFormBase.

Namespace

Drupal\config_entity_revisions

Code

public function displayUpdate() {

  // The revision timestamp will be updated when the revision is saved. Keep
  // the original one for the confirmation message.
  $original_revision_timestamp = $this->revision
    ->getRevisionCreationTime();
  $this->messenger
    ->addMessage($this
    ->t('%entity_title %title has been set to the revision from %revision-date.', [
    '%entity_title' => $this->configEntity
      ->title(),
    '%title' => $this->configEntity
      ->label(),
    '%revision-date' => $this->dateFormatter
      ->format($original_revision_timestamp),
  ]));
}