Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 402] [Versions 310 and 403]

Moodle user analysable

Copyright: 2019 David Monllao {@link http://www.davidmonllao.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 207 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

user:: (9 methods):
  __construct()
  instance()
  get_id()
  load()
  get_name()
  get_context()
  get_start()
  get_end()
  get_user_data()


Class: user  - X-Ref

Moodle user analysable

__construct($user, ?\context $context = null)   X-Ref
Constructor.

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

param: int|\stdClass $user User id
param: \context|null $context
return: void

instance($user, ?\context $context = null)   X-Ref
Returns an analytics user instance.

Lazy load of analysable data.

param: int|\stdClass $user User object or user id
param: \context|null $context
return: \core_analytics\user

get_id()   X-Ref
get_id

return: int

load()   X-Ref
Loads the analytics user object.

return: void

get_name()   X-Ref
The user full name.

return: string

get_context()   X-Ref
get_context

return: \context

get_start()   X-Ref
Get the start timestamp.

return: int

get_end()   X-Ref
Get the end timestamp.

return: int

get_user_data()   X-Ref
Returns a user plain object.

return: \stdClass