Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

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

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

Lazy load of analysable data.

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

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