Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_analytics\user Class Reference

Moodle user analysable. More...

Inheritance diagram for core_analytics\user:
core_analytics\analysable

Public Member Functions

 __construct ($user, ?\context $context=null)
 Constructor.
 
 get_context ()
 get_context
 
 get_end ()
 Get the end timestamp.
 
 get_id ()
 get_id
 
 get_name ()
 The user full name.
 
 get_start ()
 Get the start timestamp.
 
 get_user_data ()
 Returns a user plain object.
 

Static Public Member Functions

static instance ($user, ?\context $context=null)
 Returns an analytics user instance.
 

Public Attributes

const MAX_TIME = SQL_INT_MAX
 Max timestamp.
 

Protected Member Functions

 load ()
 Loads the analytics user object.
 

Protected Attributes

bool $loaded = false
 Has this user data been already loaded.
 
int int $now = 0
 Store current Unix timestamp.
 
stdClass $user = null
 User object.
 
context_user $usercontext = null
 The user context.
 

Static Protected Attributes

static int $cachedid = 0
 $cachedid self\$cachedinstance analysable id.
 
static core_analytics user $cachedinstance = null
 $cachedinstance
 

Detailed Description

Moodle user analysable.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_analytics\user::__construct ( $user,
?\context $context = null )

Constructor.

Use self\instance() instead to get cached copies of the class. Instances obtained through this constructor will not be cached.

Parameters
int | stdClass$userUser id
context | null$context
Return values
void

Member Function Documentation

◆ get_context()

core_analytics\user::get_context ( )

get_context

Return values
context

Implements core_analytics\analysable.

◆ get_end()

core_analytics\user::get_end ( )

Get the end timestamp.

Return values
int

Implements core_analytics\analysable.

◆ get_id()

core_analytics\user::get_id ( )

get_id

Return values
int

Implements core_analytics\analysable.

◆ get_name()

core_analytics\user::get_name ( )

The user full name.

Return values
string

Implements core_analytics\analysable.

◆ get_start()

core_analytics\user::get_start ( )

Get the start timestamp.

Return values
int

Implements core_analytics\analysable.

◆ get_user_data()

core_analytics\user::get_user_data ( )

Returns a user plain object.

Return values
stdClass

◆ instance()

static core_analytics\user::instance ( $user,
?\context $context = null )
static

Returns an analytics user instance.

Lazy load of analysable data.

Parameters
int | stdClass$userUser object or user id
context | null$context
Return values
core_analytics\user

◆ load()

core_analytics\user::load ( )
protected

Loads the analytics user object.

Return values
void

The documentation for this class was generated from the following file: