Added config->delete()

8.0.x
Greg Dunlap 2012-01-07 16:36:25 +01:00
parent d3eda175c1
commit ce8c168365
1 changed files with 13 additions and 0 deletions

View File

@ -536,6 +536,19 @@ class DrupalConfig {
}
}
/**
* Unset value in this config object.
*/
public function delete($key) {
$parts = explode('.', $key);
if (count($parts) == 1) {
unset($this->data[$key]);
}
else {
drupal_array_unset_nested_value($this->data, $parts);
}
}
/**
* Get value in this config object.
*/