1 config.inc public Config::clear($key)

Unsets a value in this configuration object.

Parameters

string $key: Name of the key whose value should be unset.

Return value

Config: The configuration object.

File

core/includes/config.inc, line 950
This is the API for configuration storage.

Class

Config
Defines the default configuration object.

Code

public function clear($key) {
  if (!$this->isLoaded) {
    $this->load();
  }
  $parts = explode('.', $key);
  if (count($parts) == 1) {
    unset($this->data[$key]);
  }
  else {
    $data = &$this->data;
    $last_key = array_pop($parts);
    foreach ($parts as $part) {
      $data = &$data[$part];
    }
    unset($data[$last_key]);
  }
  $this->validated = FALSE;
  return $this;
}