Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

(no description)

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

Defines 1 class


Class: course  - X-Ref

Course entity class implementation

This entity defines all the course 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 in the list of columns/filters in the report builder.

return: lang_string

get_custom_fields()   X-Ref
Get custom fields helper

return: custom_fields

initialise()   X-Ref
Initialise the entity, adding all course and custom course fields

return: base

get_context_join()   X-Ref
Return syntax for joining on the context table

return: string

get_course_fields()   X-Ref
Course fields.

return: array

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

param: string $fieldname
return: bool

get_course_field_type(string $coursefield)   X-Ref
Return appropriate column type for given user field

param: string $coursefield
return: int

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

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

return: array

get_options_for(string $fieldname)   X-Ref
Gets list of options if the filter supports it

param: string $fieldname
return: null|array

get_options_for_groupmode()   X-Ref
List of options for the field groupmode.

return: array

get_options_for_format()   X-Ref
List of options for the field format.

return: array

get_options_for_theme()   X-Ref
List of options for the field theme.

return: array

get_options_for_lang()   X-Ref
List of options for the field lang.

return: array

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

return: array

format($value, stdClass $row, string $fieldname)   X-Ref
Formats the course 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