An implementation of the user account interface for the global user.
@todo: Change all properties to protected.
Expanded class hierarchy of UserSession
class UserSession implements AccountInterface {
/**
* User ID.
*
* @var int
*/
public $uid;
/**
* Session hostname.
*
* @todo: This does not seem to be used, remove?
*
* @var string
*/
public $hostname;
/**
* List of the roles this user has.
*
* @var array
*/
public $roles;
/**
* Session ID.
*
* @var string.
*/
public $sid;
/**
* Secure session ID.
*
* @var string.
*/
public $ssid;
/**
* Session data.
*
* @var array.
*/
public $session;
/**
* The Unix timestamp when this session last requested a page.
*
* @var string.
*/
public $timestamp;
/**
* Constructs a new user session.
*
* @param array $values
* Array of initial values for the user sesion.
*/
public function __construct(array $values = array()) {
foreach ($values as $key => $value) {
$this->{$key} = $value;
}
}
/**
* {@inheritdoc}
*/
public function id() {
return $this->uid;
}
/**
* {@inheritdoc}
*/
public function getRoles() {
return $this->roles;
}
/**
* {@inheritdoc}
*/
public function getSecureSessionId() {
return $this->ssid;
}
/**
* {@inheritdoc}
*/
public function getSessionData() {
return $this->session;
}
/**
* {@inheritdoc}
*/
public function getSessionId() {
return $this->sid;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UserSession:: |
public | property | Session hostname. | |
UserSession:: |
public | property | List of the roles this user has. | |
UserSession:: |
public | property | Session data. | |
UserSession:: |
public | property | Session ID. | |
UserSession:: |
public | property | Secure session ID. | |
UserSession:: |
public | property | The Unix timestamp when this session last requested a page. | |
UserSession:: |
public | property | User ID. | |
UserSession:: |
public | function |
Returns a list of roles. Overrides AccountInterface:: |
|
UserSession:: |
public | function |
Returns the secure session ID. Overrides AccountInterface:: |
|
UserSession:: |
public | function |
Returns the session data. Overrides AccountInterface:: |
|
UserSession:: |
public | function |
Returns the session ID. Overrides AccountInterface:: |
|
UserSession:: |
public | function |
Returns the user ID or 0 for anonymous. Overrides AccountInterface:: |
|
UserSession:: |
public | function | Constructs a new user session. |