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

Defines 1 class

base_report_table:: (9 methods):
  init_sql()
  set_report_editing()
  get_filter_sql()
  query_db()
  get_sql_sort()
  get_context()
  guess_base_url()
  print_nothing_to_display()
  start_html()


Class: base_report_table  - X-Ref

Base report dynamic table class

init_sql(string $fields, string $from, array $joins, string $where, array $params,array $groupby = [])   X-Ref
Initialises table SQL properties

param: string $fields
param: string $from
param: array $joins
param: string $where
param: array $params
param: array $groupby

set_report_editing(bool $editing)   X-Ref
Whether the current report table is being edited, in which case certain actions are not applied to it, e.g. user filtering
and sorting. Default class value is false

param: bool $editing

get_filter_sql(filter $filter, array $filtervalues)   X-Ref
Return SQL fragments from given filter instance suitable for inclusion in table SQL

return: array [$sql, $params]
param: filter $filter
param: array $filtervalues

query_db($pagesize, $useinitialsbar = true)   X-Ref
Override parent method of the same, to make use of a recordset and avoid issues with duplicate values in the first column

param: int $pagesize
param: bool $useinitialsbar

get_sql_sort()   X-Ref
Override parent method of the same, to ensure that any columns with custom sort fields are accounted for

return: string

get_context()   X-Ref
Get the context for the table (that of the report persistent)

return: context

guess_base_url()   X-Ref
Set the base URL of the table to the current page URL


print_nothing_to_display()   X-Ref
Override print_nothing_to_display to modity the output styles.


start_html()   X-Ref
Override start of HTML to remove top pagination.