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 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 445 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: user  - X-Ref

User entity class implementation.

This entity defines all the user columns and filters to be used in any report.

get_default_table_aliases()   X-Ref
Database tables that this entity uses and their default aliases

return: array

get_default_entity_title()   X-Ref
The default title for this entity

return: lang_string

initialise()   X-Ref
Initialise the entity, add all user fields and all 'visible' user profile fields

return: base

get_user_profile_fields()   X-Ref
Get user profile fields helper instance

return: user_profile_fields

get_all_columns()   X-Ref
Returns list of all available columns

These are all the columns available to use in any report that uses this entity.

return: column[]

is_sortable(string $fieldname)   X-Ref
Check if this field is sortable

return: bool
param: string $fieldname

format($value, stdClass $row, string $fieldname)   X-Ref
Formats the user field for display.

return: string
param: mixed $value Current field value.
param: stdClass $row Complete row.
param: string $fieldname Name of the field to format.

get_name_fields_select(string $usertablealias = 'u')   X-Ref
Returns a SQL statement to select all user fields necessary for fullname() function

Note the implementation here is similar to {@see fields::get_sql_fullname} but without concatenation

return: string
param: string $usertablealias

get_user_fields()   X-Ref
User fields

return: lang_string[]

get_user_field_type(string $userfield)   X-Ref
Return appropriate column type for given user field

return: int
param: string $userfield

get_all_filters()   X-Ref
Return list of all available filters

return: filter[]

get_options_for_country()   X-Ref
List of options for the field country.

return: string[]