Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
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. More...
 
 get_context ()
 get_context More...
 
 get_end ()
 Get the end timestamp. More...
 
 get_id ()
 get_id More...
 
 get_name ()
 The user full name. More...
 
 get_start ()
 Get the start timestamp. More...
 
 get_user_data ()
 Returns a user plain object. More...
 

Static Public Member Functions

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

Public Attributes

const MAX_TIME = 9999999999
 Max timestamp.
 

Protected Member Functions

 load ()
 Loads the analytics user object. More...
 

Protected Attributes

bool $loaded = false
 Has this user data been already loaded.
 
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

◆ 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: