- Users\User
class Users \ User
Represents a user instance. Does not deal with authentication methods (e.g. passwords, OpenID, OAuth2).
Method Summary
Name | Description |
---|---|
__construct($params) | Construct a user instance from the given user parameters (from the database). |
__toString() | |
delete(Connection $db) | Delete the given user. Triggers a 'user_deleted' event with the current user as an argument. |
findUser(Connection $db, $user_id) | |
forceLogin(Connection $db, $user_id) | Login as the given user_id. |
getEmail() | |
getId() | |
getIdentity() | Get the identity used to log in this user; persists across requests as it is stored in session. |
getInstance(Connection $db) |
Get the current logged in user instance, or null if there is none, based on session variables. |
isAutoLoggedIn() | Was this user logged in automatically *in this session*? |
logout(Connection $db) | |
persist(Connection $db, $use_cookies = false) | |
setIdentity($identity) | |
tryAutoLogin() |
public function __construct($params)
Construct a user instance from the given user parameters (from the database).
public function __toString()
public function delete(Connection $db)
Delete the given user. Triggers a 'user_deleted' event with the current user as an argument.
static function findUser(Connection $db, $user_id)
static function forceLogin(Connection $db, $user_id)
Login as the given user_id.
public function getEmail()
public function getId()
public function getIdentity()
Get the identity used to log in this user; persists across requests as it is stored in session.
static function getInstance(Connection $db)
Get the current logged in user instance, or
null
if there is none, based on session variables.
- Returns:
the User logged in ornull
if none
public function isAutoLoggedIn()
Was this user logged in automatically *in this session*?
static function logout(Connection $db)
public function persist(Connection $db, $use_cookies = false)
- Defaults:
use_cookies
=false