You are here

public function ConfigEntityRevisionsRevertFormBase::applyRevisionChange in Config Entity Revisions 1.x

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

Apply the revision insert/update.

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

File

src/ConfigEntityRevisionsRevertFormBase.php, line 234

Class

ConfigEntityRevisionsRevertFormBase
Provides a form for reverting / publishing a revision.

Namespace

Drupal\config_entity_revisions

Code

public function applyRevisionChange() {
  if ($this->action == 'revert') {
    $this->revision = $this
      ->prepareRevertedRevision($this->revision);
  }
  else {
    $this->revision = $this
      ->prepareToPublishCurrentRevision($this->revision);
  }
  $this->revision
    ->save();
}