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: 327 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: base  - X-Ref

Base class for all report entities

get_default_entity_name()   X-Ref
The default machine-readable name for this entity that will be used in the internal names of the columns/filters

return: string

set_entity_name(string $entityname)   X-Ref
Set entity name

param: string $entityname
return: self

get_entity_name()   X-Ref
Return entity name

return: string

set_entity_title(lang_string $title)   X-Ref
Set entity title

param: lang_string $title
return: self

get_entity_title()   X-Ref
Get entity title

return: lang_string

set_table_alias(string $tablename, string $alias)   X-Ref
Override the default alias for given database table used in entity queries, to avoid table alias clashes that may occur
if multiple entities of a report each define the same default alias for one of their tables

param: string $tablename
param: string $alias
return: self

set_table_aliases(array $aliases)   X-Ref
Override multiple default database table aliases used in entity queries as per {@see set_table_alias}, typically when
you're adding an entity multiple times to a report you'd want to override the table aliases in the second instance to
avoid clashes with the first

param: array $aliases Array of tablename => alias values
return: self

get_table_alias(string $tablename)   X-Ref
Returns an alias used in the queries for a given table

param: string $tablename
return: string

add_join(string $join)   X-Ref
Add join clause required for this entity to join to existing tables/entities

param: string $join
return: self

add_joins(array $joins)   X-Ref
Add multiple join clauses required for this entity {@see add_join}

param: string[] $joins
return: self

get_joins()   X-Ref
Return entity joins

return: string[]

add_column(column $column)   X-Ref
Add a column to the entity

param: column $column
return: self

get_columns()   X-Ref
Returns entity columns

return: column[]

get_column(string $name)   X-Ref
Returns an entity column

param: string $name
return: column

add_filter(filter $filter)   X-Ref
Add a filter to the entity

param: filter $filter
return: self

get_filters()   X-Ref
Returns entity filters

return: filter[]

get_filter(string $name)   X-Ref
Returns an entity filter

param: string $name
return: filter

add_condition(filter $condition)   X-Ref
Add a condition to the entity

param: filter $condition
return: $this

get_conditions()   X-Ref
Returns entity conditions

return: filter[]

get_condition(string $name)   X-Ref
Returns an entity condition

param: string $name
return: filter