public function ConfigHelper::delete in Lightning Core 8.5
Same name and namespace in other branches
- 8 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 123
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 (mb_strpos($id, $prefix) === 0) {
$entity = $this
->getEntity($entity_type, mb_substr($id, mb_strlen($prefix)));
return $entity
->delete();
}
}
return $this
->get($id)
->delete();
}