function UserSession::__set
Implements magic __set() method.
File
-
core/
lib/ Drupal/ Core/ Session/ UserSession.php, line 248
Class
- UserSession
- An implementation of the user account interface for the global user.
Namespace
Drupal\Core\SessionCode
public function __set($name, $value) : void {
if ($name === 'name') {
@trigger_error("Setting the name property is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Set the name via the constructor when creating the UserSession instance. See https://www.drupal.org/node/3513856", E_USER_DEPRECATED);
$this->name = $value;
return;
}
$class = get_class($this);
$properties = get_class_vars($class);
if (\array_key_exists($name, $properties)) {
throw new \LogicException("Cannot set protected property {$name} in " . $class);
}
$this->{$name} = $value;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.