W3cubDocs

/Drupal 8

public function ConfigEntityStorage::importDelete

public ConfigEntityStorage::importDelete($name, Config $new_config, Config $old_config)

Delete entities upon synchronizing configuration changes.

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.

Overrides ImportableEntityStorageInterface::importDelete

File

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

Class

ConfigEntityStorage
Defines the storage 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->entityType->getConfigPrefix());
  $entity = $this->load($id);
  $entity->setSyncing(TRUE);
  $entity->delete();
  return TRUE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!ConfigEntityStorage.php/function/ConfigEntityStorage::importDelete/8.1.x