public function UserSession::__construct

public UserSession::__construct(array $values = array())

Constructs a new user session.

Parameters

array $values: Array of initial values for the user session.

File

core/lib/Drupal/Core/Session/UserSession.php, line 76

Class

UserSession
An implementation of the user account interface for the global user.

Namespace

Drupal\Core\Session

Code

public function __construct(array $values = array()) {
  foreach ($values as $key => $value) {
    $this->$key = $value;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Session!UserSession.php/function/UserSession::__construct/8.1.x