function State::get
Same name in other branches
- 9 core/lib/Drupal/Core/State/State.php \Drupal\Core\State\State::get()
- 8.9.x core/lib/Drupal/Core/State/State.php \Drupal\Core\State\State::get()
- 10 core/lib/Drupal/Core/State/State.php \Drupal\Core\State\State::get()
Overrides CacheCollector::get
1 call to State::get()
- State::getMultiple in core/
lib/ Drupal/ Core/ State/ State.php
File
-
core/
lib/ Drupal/ Core/ State/ State.php, line 51
Class
- State
- Provides the state system using a key value store.
Namespace
Drupal\Core\StateCode
public function get($key, $default = NULL) {
// If the caller is asking for the value of a deprecated state, trigger a
// deprecation message about it.
if (isset(self::$deprecatedState[$key])) {
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error(self::$deprecatedState[$key]['message'], E_USER_DEPRECATED);
$key = self::$deprecatedState[$key]['replacement'];
}
return parent::get($key) ?? $default;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.