You are here

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

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

Update config entity.

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

File

src/ConfigEntityRevisionsRevertFormBase.php, line 247

Class

ConfigEntityRevisionsRevertFormBase
Provides a form for reverting / publishing a revision.

Namespace

Drupal\config_entity_revisions

Code

public function updateConfigEntity() {
  $this->config_entity = \Drupal::getContainer()
    ->get('serializer')
    ->deserialize($this->revision
    ->get('configuration')->value, get_class($this->config_entity), 'json');
  $this->config_entity
    ->enforceIsNew(FALSE);
  $this->config_entity
    ->set('settingsOriginal', $this->config_entity
    ->get('settings'));
  $this->config_entity
    ->set('revision_id', $this->revision
    ->getRevisionId());
  $this->config_entity
    ->save();
}