Search moodle.org's
Developer Documentation

See Release Notes

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

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

(no description)

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

Defines 1 class

base_report_table:: (10 methods):
  init_sql()
  set_report_editing()
  get_filter_sql()
  get_table_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

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

get_table_sql()   X-Ref
Generate suitable SQL for the table

return: string

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.