Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 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