public function ConfigStorageController::importDelete

Delete configuration upon synchronizing configuration changes.

This callback is invoked when configuration is synchronized between storages and allows a module to take over the synchronization of configuration data.

Parameters

string $name: The name of the configuration object.

\Drupal\Core\Config\Config $new_config: A configuration object containing the new configuration data.

\Drupal\Core\Config\Config $old_config: A configuration object containing the old configuration data.

2 calls to ConfigStorageController::importDelete()
ConfigTestStorageController::importDelete in drupal/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php
Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importDelete().
FieldInstanceStorageController::importDelete in drupal/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
Delete configuration upon synchronizing configuration changes.
2 methods override ConfigStorageController::importDelete()
ConfigTestStorageController::importDelete in drupal/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php
Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importDelete().
FieldInstanceStorageController::importDelete in drupal/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
Delete configuration upon synchronizing configuration changes.

File

drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php, line 531
Definition of Drupal\Core\Config\Entity\ConfigStorageController.

Class

ConfigStorageController
Defines the storage controller class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

public function importDelete($name, Config $new_config, Config $old_config) {
  $id = static::getIDFromConfigName($name, $this->entityInfo['config_prefix']);
  $entities = $this
    ->load(array(
    $id,
  ));
  $entity = $entities[$id];
  $entity
    ->delete();
  return TRUE;
}