Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_reportbuilder\local\entities\course Class Reference
Inheritance diagram for core_reportbuilder\local\entities\course:
core_reportbuilder\local\entities\base

Public Member Functions

 add_join (string $join)
 Add join clause required for this entity to join to existing tables/entities.
 
 add_joins (array $joins)
 Add multiple join clauses required for this entity {.
 
 format ($value, stdClass $row, string $fieldname)
 Formats the course field for display.
 
 get_column (string $name)
 Returns an entity column.
 
 get_columns ()
 Returns entity columns.
 
 get_condition (string $name)
 Returns an entity condition.
 
 get_conditions ()
 Returns entity conditions.
 
 get_context_join ()
 Return syntax for joining on the context table.
 
 get_entity_name ()
 Return entity name.
 
 get_entity_title ()
 Get entity title.
 
 get_filter (string $name)
 Returns an entity filter.
 
 get_filters ()
 Returns entity filters.
 
 get_joins ()
 Return entity joins.
 
 get_table_alias (string $tablename)
 Returns an alias used in the queries for a given table.
 
 get_table_aliases ()
 Returns aliases used in the queries for all tables.
 
 get_tag_joins ()
 Return joins necessary for retrieving tags.
 
 has_table_join_alias (string $tablename)
 Determine whether defined table join alias was specified.
 
 initialise ()
 Initialise the entity, adding all course and custom course fields.
 
 set_entity_name (string $entityname)
 Set entity name.
 
 set_entity_title (lang_string $title)
 Set entity title.
 
 set_table_alias (string $tablename, string $alias)
 Override the default alias for given database table used in entity queries, for instance when the same table is used by multiple entities and you want them each to refer to it by the same alias.
 
 set_table_aliases (array $aliases)
 Override multiple default database table aliases used in entity queries as per {.
 
 set_table_join_alias (string $tablename, string $alias)
 Set the alias for given database table that has already been added to the report.
 

Static Public Member Functions

static get_options_for_calendartype ()
 List of options for the field.
 
static get_options_for_format ()
 List of options for the field format.
 
static get_options_for_groupmode ()
 List of options for the field groupmode.
 
static get_options_for_lang ()
 List of options for the field lang.
 
static get_options_for_theme ()
 List of options for the field theme.
 

Protected Member Functions

 add_column (column $column)
 Add a column to the entity.
 
 add_condition (filter $condition)
 Add a condition to the entity.
 
 add_filter (filter $filter)
 Add a filter to the entity.
 
 get_all_columns ()
 Returns list of all available columns.
 
 get_all_filters ()
 Returns list of all available filters.
 
 get_course_field_type (string $coursefield)
 Return appropriate column type for given user field.
 
 get_course_fields ()
 Course fields.
 
 get_custom_fields ()
 Get custom fields helper.
 
 get_default_entity_title ()
 The default title for this entity in the list of columns/filters in the report builder.
 
 get_default_table_aliases ()
 Database tables that this entity uses and their default aliases (note that these aliases are now ignored)
 
 get_default_tables ()
 Database tables that this entity uses.
 
 get_options_for (string $fieldname)
 Gets list of options if the filter supports it.
 
 get_tag_joins_for_entity (string $component, string $itemtype, string $itemidfield)
 Helper method for returning joins necessary for retrieving tags related to the current entity.
 
 is_sortable (string $fieldname)
 Check if this field is sortable.
 

Member Function Documentation

◆ add_column()

core_reportbuilder\local\entities\base::add_column ( column $column)
finalprotectedinherited

Add a column to the entity.

Parameters
column$column
Return values
self

◆ add_condition()

core_reportbuilder\local\entities\base::add_condition ( filter $condition)
finalprotectedinherited

Add a condition to the entity.

Parameters
filter$condition
Return values
$this

◆ add_filter()

core_reportbuilder\local\entities\base::add_filter ( filter $filter)
finalprotectedinherited

Add a filter to the entity.

Parameters
filter$filter
Return values
self

◆ add_join()

core_reportbuilder\local\entities\base::add_join ( string $join)
finalinherited

Add join clause required for this entity to join to existing tables/entities.

Parameters
string$join
Return values
self

◆ add_joins()

core_reportbuilder\local\entities\base::add_joins ( array $joins)
finalinherited

Add multiple join clauses required for this entity {.

See also
add_join}
Parameters
string[]$joins
Return values
self

◆ format()

core_reportbuilder\local\entities\course::format ( $value,
stdClass $row,
string $fieldname )

Formats the course field for display.

Parameters
mixed$valueCurrent field value.
stdClass$rowComplete row.
string$fieldnameName of the field to format.
Return values
string

◆ get_all_columns()

core_reportbuilder\local\entities\course::get_all_columns ( )
protected

Returns list of all available columns.

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

Return values
column[]

◆ get_all_filters()

core_reportbuilder\local\entities\course::get_all_filters ( )
protected

Returns list of all available filters.

Return values
array

◆ get_column()

core_reportbuilder\local\entities\base::get_column ( string $name)
finalinherited

Returns an entity column.

Parameters
string$name
Return values
column
Exceptions
coding_exceptionFor invalid column name

◆ get_columns()

core_reportbuilder\local\entities\base::get_columns ( )
finalinherited

Returns entity columns.

Return values
column[]

◆ get_condition()

core_reportbuilder\local\entities\base::get_condition ( string $name)
finalinherited

Returns an entity condition.

Parameters
string$name
Return values
filter
Exceptions
coding_exceptionFor invalid condition name

◆ get_conditions()

core_reportbuilder\local\entities\base::get_conditions ( )
finalinherited

Returns entity conditions.

Return values
filter[]

◆ get_context_join()

core_reportbuilder\local\entities\course::get_context_join ( )

Return syntax for joining on the context table.

Return values
string

◆ get_course_field_type()

core_reportbuilder\local\entities\course::get_course_field_type ( string $coursefield)
protected

Return appropriate column type for given user field.

Parameters
string$coursefield
Return values
int

◆ get_course_fields()

core_reportbuilder\local\entities\course::get_course_fields ( )
protected

Course fields.

Return values
array

◆ get_custom_fields()

core_reportbuilder\local\entities\course::get_custom_fields ( )
protected

Get custom fields helper.

Return values
custom_fields

◆ get_default_entity_title()

core_reportbuilder\local\entities\course::get_default_entity_title ( )
protected

The default title for this entity in the list of columns/filters in the report builder.

Return values
lang_string

Reimplemented from core_reportbuilder\local\entities\base.

◆ get_default_table_aliases()

core_reportbuilder\local\entities\base::get_default_table_aliases ( )
protectedinherited

Database tables that this entity uses and their default aliases (note that these aliases are now ignored)

Return values
string[]Array of $tablename => $alias
Deprecated
since Moodle 4.4 - aliases are now autogenerated, please implement {
See also
get_default_tables} instead

◆ get_default_tables()

core_reportbuilder\local\entities\course::get_default_tables ( )
protected

Database tables that this entity uses.

Return values
string[]

Reimplemented from core_reportbuilder\local\entities\base.

◆ get_entity_name()

core_reportbuilder\local\entities\base::get_entity_name ( )
finalinherited

Return entity name.

Return values
string

◆ get_entity_title()

core_reportbuilder\local\entities\base::get_entity_title ( )
finalinherited

Get entity title.

Return values
lang_string

◆ get_filter()

core_reportbuilder\local\entities\base::get_filter ( string $name)
finalinherited

Returns an entity filter.

Parameters
string$name
Return values
filter
Exceptions
coding_exceptionFor invalid filter name

◆ get_filters()

core_reportbuilder\local\entities\base::get_filters ( )
finalinherited

Returns entity filters.

Return values
filter[]

◆ get_joins()

core_reportbuilder\local\entities\base::get_joins ( )
finalinherited

Return entity joins.

Return values
string[]

◆ get_options_for()

core_reportbuilder\local\entities\course::get_options_for ( string $fieldname)
protected

Gets list of options if the filter supports it.

Parameters
string$fieldname
Return values
null|array

◆ get_options_for_calendartype()

static core_reportbuilder\local\entities\course::get_options_for_calendartype ( )
static

List of options for the field.

Return values
array

◆ get_options_for_format()

static core_reportbuilder\local\entities\course::get_options_for_format ( )
static

List of options for the field format.

Return values
array

◆ get_options_for_groupmode()

static core_reportbuilder\local\entities\course::get_options_for_groupmode ( )
static

List of options for the field groupmode.

Return values
array

◆ get_options_for_lang()

static core_reportbuilder\local\entities\course::get_options_for_lang ( )
static

List of options for the field lang.

Return values
array

◆ get_options_for_theme()

static core_reportbuilder\local\entities\course::get_options_for_theme ( )
static

List of options for the field theme.

Return values
array

◆ get_table_alias()

core_reportbuilder\local\entities\base::get_table_alias ( string $tablename)
finalinherited

Returns an alias used in the queries for a given table.

Parameters
string$tablenameOne of the tables set by {
See also
get_default_tables}
Return values
string
Exceptions
coding_exceptionFor invalid table name

◆ get_table_aliases()

core_reportbuilder\local\entities\base::get_table_aliases ( )
finalinherited

Returns aliases used in the queries for all tables.

Return values
string[]

◆ get_tag_joins()

core_reportbuilder\local\entities\course::get_tag_joins ( )

Return joins necessary for retrieving tags.

Return values
string[]

◆ get_tag_joins_for_entity()

core_reportbuilder\local\entities\base::get_tag_joins_for_entity ( string $component,
string $itemtype,
string $itemidfield )
finalprotectedinherited

Helper method for returning joins necessary for retrieving tags related to the current entity.

Both 'tag' and 'tag_instance' aliases must be returned by the entity {

See also
get_default_tables} method
Parameters
string$component
string$itemtype
string$itemidfield
Return values
string[]

◆ has_table_join_alias()

core_reportbuilder\local\entities\base::has_table_join_alias ( string $tablename)
finalinherited

Determine whether defined table join alias was specified.

Call {

See also
get_table_alias} to retrieve said value
Parameters
string$tablename
Return values
bool

◆ initialise()

core_reportbuilder\local\entities\course::initialise ( )

Initialise the entity, adding all course and custom course fields.

Return values
base

Reimplemented from core_reportbuilder\local\entities\base.

◆ is_sortable()

core_reportbuilder\local\entities\course::is_sortable ( string $fieldname)
protected

Check if this field is sortable.

Parameters
string$fieldname
Return values
bool

◆ set_entity_name()

core_reportbuilder\local\entities\base::set_entity_name ( string $entityname)
finalinherited

Set entity name.

Parameters
string$entityname
Return values
self

◆ set_entity_title()

core_reportbuilder\local\entities\base::set_entity_title ( lang_string $title)
finalinherited

Set entity title.

Parameters
lang_string$title
Return values
self

◆ set_table_alias()

core_reportbuilder\local\entities\base::set_table_alias ( string $tablename,
string $alias )
finalinherited

Override the default alias for given database table used in entity queries, for instance when the same table is used by multiple entities and you want them each to refer to it by the same alias.

Parameters
string$tablenameOne of the tables set by {
See also
get_default_tables}
Parameters
string$alias
Return values
self
Exceptions
coding_exceptionFor invalid table name

◆ set_table_aliases()

core_reportbuilder\local\entities\base::set_table_aliases ( array $aliases)
finalinherited

Override multiple default database table aliases used in entity queries as per {.

See also
set_table_alias}
Parameters
array$aliasesArray of tablename => alias values
Return values
self

◆ set_table_join_alias()

core_reportbuilder\local\entities\base::set_table_join_alias ( string $tablename,
string $alias )
finalinherited

Set the alias for given database table that has already been added to the report.

Enables entities to avoid additional joins on the same table by allowing re-use of existing table aliases in their own queries, {

See also
has_table_join_alias}
Parameters
string$tablename
string$alias
Return values
self

The documentation for this class was generated from the following file: