function ConfigEntityStorage::importUpdate

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php \Drupal\Core\Config\Entity\ConfigEntityStorage::importUpdate()
  2. 8.9.x core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php \Drupal\Core\Config\Entity\ConfigEntityStorage::importUpdate()
  3. 11.x core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php \Drupal\Core\Config\Entity\ConfigEntityStorage::importUpdate()

Overrides ImportableEntityStorageInterface::importUpdate

2 calls to ConfigEntityStorage::importUpdate()
ConfigEntityStorage::importRename in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Renames entities upon synchronizing configuration changes.
ConfigTestStorage::importUpdate in core/modules/config/tests/config_test/src/ConfigTestStorage.php
Updates entities upon synchronizing configuration changes.
1 method overrides ConfigEntityStorage::importUpdate()
ConfigTestStorage::importUpdate in core/modules/config/tests/config_test/src/ConfigTestStorage.php
Updates entities upon synchronizing configuration changes.

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php, line 365

Class

ConfigEntityStorage
Defines the storage class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

public function importUpdate($name, Config $new_config, Config $old_config) {
    $id = static::getIDFromConfigName($name, $this->entityType
        ->getConfigPrefix());
    $entity = $this->load($id);
    if (!$entity) {
        throw new ConfigImporterException("Attempt to update non-existing entity '{$id}'.");
    }
    $entity->setSyncing(TRUE);
    $entity = $this->updateFromStorageRecord($entity, $new_config->get());
    $entity->save();
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.