pfeifferNet

Users
in package

Common user functionality.

Provides data for registration, previous login and last login dates. Provides for user lists by role.

Tags
since
5.9.0
since
5.11.0

Deprecated global singleton.

used-by
Send_Email::__construct()
used-by
Users::__construct()
used-by
User_Login_History::__construct()

Table of Contents

Constants

LAST_LOGIN_KEY  = 'pnet_login_last'
Metadata key for last login.
PREVIOUS_LOGIN_KEY  = 'pnet_login_previous'
Metadata key for previous login.
REGISTRATION_KEY  = 'user_registered'
Metadata key for registration date.

Properties

$instances  : array<string|int, object>
The array of instances of this class and sub-classes.

Methods

get_by_role()  : array<string|int, mixed>
Return users selected by role, or all users.
get_instance()  : object
Creates and/or returns the instance of this class.
get_last_login_date()  : string
Return the last login date for a user.
get_previous_login_date()  : string
Return the last but one login date for a user.
get_registration_date()  : string
Returns the registration date for a user.
__construct()  : void
Initialise the class.

Constants

PREVIOUS_LOGIN_KEY

Metadata key for previous login.

public string PREVIOUS_LOGIN_KEY = 'pnet_login_previous'
Tags
since
5.9.0

Properties

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

get_previous_login_date()

Return the last but one login date for a user.

public get_previous_login_date(int $user_id) : string
Parameters
$user_id : int

User id.

Tags
since
5.9.0
used-by
User_Login_History::render()
Return values
string

The previous login date string, or null.

__construct()

Initialise the class.

protected __construct() : void
Tags
since
5.11.0

        
On this page

Search results