Sets value in this config object.
string $key: Identifier to store value in config.
string $value: Value to associate with identifier.
Drupal\Core\Config\Config The configuration object.
public function set($key, $value) {
// Type-cast value into a string.
$value = $this
->castValue($value);
// The dot/period is a reserved character; it may appear between keys, but
// not within keys.
$parts = explode('.', $key);
if (count($parts) == 1) {
$this->data[$key] = $value;
}
else {
NestedArray::setValue($this->data, $parts, $value);
}
$this
->resetOverriddenData();
return $this;
}