Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core_reportbuilder\table\base_report_table Class Reference
Inheritance diagram for core_reportbuilder\table\base_report_table:
core_table\dynamic core_reportbuilder\table\custom_report_table core_reportbuilder\table\system_report_table core_reportbuilder\table\custom_report_table_view

Public Member Functions

 get_context ()
 Get the context for the table (that of the report persistent)
 
 get_sql_sort ()
 Override parent method of the same, to ensure that any columns with custom sort fields are accounted for.
 
 get_total_row_count ()
 Return total row count for report table.
 
 guess_base_url ()
 Set the base URL of the table to the current page URL.
 
 has_capability ()
 Check capability for users accessing the dynamic table.
 
 print_nothing_to_display ()
 Override print_nothing_to_display to modity the output styles.
 
 query_db ($pagesize, $useinitialsbar=true)
 Override parent method of the same, to make use of a recordset and avoid issues with duplicate values in the first column.
 
 set_report_editing (bool $editing)
 Whether the current report table is being edited, in which case certain actions are not applied to it, e.g.
 
 start_html ()
 Override start of HTML to remove top pagination.
 

Protected Member Functions

 get_table_sql (bool $includesort=true)
 Generate suitable SQL for the table.
 
 init_sql (string $fields, string $from, array $joins, string $where, array $params, array $groupby=[])
 Initialises table SQL properties.
 

Protected Attributes

bool $editing = false
 $editing
 
string $groupbysql = ''
 $groupbysql
 
report $persistent
 $persistent
 
base_report $report
 $report
 

Member Function Documentation

◆ get_context()

core_reportbuilder\table\base_report_table::get_context ( )

Get the context for the table (that of the report persistent)

Return values
context

◆ get_sql_sort()

core_reportbuilder\table\base_report_table::get_sql_sort ( )

Override parent method of the same, to ensure that any columns with custom sort fields are accounted for.

Because the base table_sql has "special" handling of fullname columns {

See also
table_sql::contains_fullname_columns}, we need to handle that here to ensure that any that are being sorted take priority over reportbuilders own aliases of the same columns. This prevents them appearing multiple times in a query, which SQL Server really doesn't like
Return values
string

◆ get_table_sql()

core_reportbuilder\table\base_report_table::get_table_sql ( bool $includesort = true)
protected

Generate suitable SQL for the table.

Parameters
bool$includesort
Return values
string

◆ get_total_row_count()

core_reportbuilder\table\base_report_table::get_total_row_count ( )

Return total row count for report table.

Note we'd typically use {

See also
query_db} and then read the {
totalrows} property to reduce DB calls, however we can use this method when we specifically don't also need to obtain all data
Return values
int

◆ has_capability()

core_table\dynamic::has_capability ( )
inherited

Check capability for users accessing the dynamic table.

Return values
bool

Implemented in core_reportbuilder\table\custom_report_table, core_reportbuilder\table\custom_report_table_view, and core_reportbuilder\table\system_report_table.

◆ init_sql()

core_reportbuilder\table\base_report_table::init_sql ( string $fields,
string $from,
array $joins,
string $where,
array $params,
array $groupby = [] )
protected

Initialises table SQL properties.

Parameters
string$fields
string$from
array$joins
string$where
array$params
array$groupby

◆ print_nothing_to_display()

core_reportbuilder\table\base_report_table::print_nothing_to_display ( )

Override print_nothing_to_display to modity the output styles.

Reimplemented in core_reportbuilder\table\custom_report_table.

◆ query_db()

core_reportbuilder\table\base_report_table::query_db ( $pagesize,
$useinitialsbar = true )

Override parent method of the same, to make use of a recordset and avoid issues with duplicate values in the first column.

Parameters
int$pagesize
bool$useinitialsbar

◆ set_report_editing()

core_reportbuilder\table\base_report_table::set_report_editing ( bool $editing)

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

Parameters
bool$editing

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