public function ConfigHelper::delete in Lightning Core 8
Same name and namespace in other branches
- 8.5 src/ConfigHelper.php \Drupal\lightning_core\ConfigHelper::delete()
- 8.2 src/ConfigHelper.php \Drupal\lightning_core\ConfigHelper::delete()
- 8.3 src/ConfigHelper.php \Drupal\lightning_core\ConfigHelper::delete()
- 8.4 src/ConfigHelper.php \Drupal\lightning_core\ConfigHelper::delete()
Overrides Drupal\Core\Config\FileStorage::delete().
Throws
\Drupal\Core\Config\StorageException
Overrides InstallStorage::delete
1 call to ConfigHelper::delete()
- ConfigHelper::deleteAll in src/
ConfigHelper.php - Overrides Drupal\Core\Config\FileStorage::deleteAll().
File
- src/
ConfigHelper.php, line 124
Class
- ConfigHelper
- A facade to assist with manipulating default config.
Namespace
Drupal\lightning_coreCode
public function delete($id) {
foreach ($this
->getConfigPrefixes() as $entity_type => $prefix) {
$prefix .= '.';
if (Unicode::strpos($id, $prefix) === 0) {
$entity = $this
->getEntity($entity_type, Unicode::substr($id, Unicode::strlen($prefix)));
return $entity
->delete();
}
}
return $this
->get($id)
->delete();
}