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

(no description)

File Size: 568 lines (21 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_identity_column(string $identityfield)   X-Ref
Returns column that corresponds to the given identity field, profile field identifiers will be converted to those
used by the {@see user_profile_fields} helper

param: string $identityfield Field from the user table, or a custom profile field
return: column

get_identity_filter(string $identityfield)   X-Ref
Returns filter that corresponds to the given identity field, profile field identifiers will be converted to those
used by the {@see user_profile_fields} helper

param: string $identityfield Field from the user table, or a custom profile field
return: filter

get_tag_joins()   X-Ref
Return joins necessary for retrieving tags

return: string[]

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

param: string $fieldname
return: bool

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

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

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

param: string $usertablealias
return: string

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

param: string $userfield
return: int

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[]