|
Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Public Member Functions | |
| __construct (string $uniqueid, string $download='') | |
| Table constructor. | |
| download_buttons () | |
| Download is disabled when editing the report. | |
| format_row ($row) | |
| Format each row of returned data, executing defined callbacks for the row and each column. | |
| get_context () | |
| Get the context for the table (that of the report persistent) | |
| get_row_cells_html (string $rowid, array $row, ?array $suppresslastrow) | |
| Override get_row_cells_html to add an extra cell with the toggle button for card view. | |
| get_sort_columns () | |
| Get user preferred sort columns, overriding those of parent. | |
| 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 if the user has the capability to access this table. | |
| out ($pagesize, $useinitialsbar, $downloadhelpbutton='') | |
| Overriding this method to handle live editing setting. | |
| print_headers () | |
| Override parent method for printing headers so we can render our custom controls in each cell. | |
| print_nothing_to_display () | |
| Override print_nothing_to_display to ensure that column headers are always added. | |
| 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. | |
| wrap_html_finish () | |
| Provide additional table debugging during editing. | |
Static Public Member Functions | |
| static | create (int $reportid, string $download='') |
| Return a new instance of the class for given report ID. | |
Protected Member Functions | |
| get_active_columns () | |
| Get the columns of the custom report, returned instances being valid and available for the user. | |
| 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 | |
| datasource | $report |
| $report | |
| bool const | REPORT_EDITING = true |
| Whether report is being edited (we don't want user filters/sorting to be applied when editing) | |
| core_reportbuilder\table\custom_report_table::__construct | ( | string | $uniqueid, |
| string | $download = '' ) |
Table constructor.
Note that the passed unique ID value must match the pattern "custom-report-table-(::d+)" so that dynamic updates continue to load the same report
| string | $uniqueid | |
| string | $download |
| moodle_exception | For invalid unique ID |
|
static |
Return a new instance of the class for given report ID.
| int | $reportid | |
| string | $download |
| static |
| core_reportbuilder\table\custom_report_table::download_buttons | ( | ) |
Download is disabled when editing the report.
| string |
Reimplemented in core_reportbuilder\table\custom_report_table_view.
| core_reportbuilder\table\custom_report_table::format_row | ( | $row | ) |
Format each row of returned data, executing defined callbacks for the row and each column.
| array | stdClass | $row |
| array |
|
protected |
Get the columns of the custom report, returned instances being valid and available for the user.
| column[] |
|
inherited |
Get the context for the table (that of the report persistent)
| context |
| core_reportbuilder\table\custom_report_table::get_row_cells_html | ( | string | $rowid, |
| array | $row, | ||
| ?array | $suppresslastrow ) |
Override get_row_cells_html to add an extra cell with the toggle button for card view.
| string | $rowid | |
| array | $row | |
| array | null | $suppresslastrow |
| string |
| core_reportbuilder\table\custom_report_table::get_sort_columns | ( | ) |
Get user preferred sort columns, overriding those of parent.
If user has no preferences then use report defaults
| array |
|
inherited |
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 {
| string |
|
protectedinherited |
Generate suitable SQL for the table.
| bool | $includesort |
| string |
|
inherited |
Return total row count for report table.
Note we'd typically use {
| int |
| core_reportbuilder\table\custom_report_table::has_capability | ( | ) |
Check if the user has the capability to access this table.
| bool | Return true if capability check passed. |
Implements core_table\dynamic.
Reimplemented in core_reportbuilder\table\custom_report_table_view.
|
protectedinherited |
Initialises table SQL properties.
| string | $fields | |
| string | $from | |
| array | $joins | |
| string | $where | |
| array | $params | |
| array | $groupby |
| core_reportbuilder\table\custom_report_table::out | ( | $pagesize, | |
| $useinitialsbar, | |||
| $downloadhelpbutton = '' ) |
Overriding this method to handle live editing setting.
| int | $pagesize | |
| bool | $useinitialsbar | |
| string | $downloadhelpbutton |
| core_reportbuilder\table\custom_report_table::print_headers | ( | ) |
Override parent method for printing headers so we can render our custom controls in each cell.
Reimplemented in core_reportbuilder\table\custom_report_table_view.
| core_reportbuilder\table\custom_report_table::print_nothing_to_display | ( | ) |
Override print_nothing_to_display to ensure that column headers are always added.
Reimplemented from core_reportbuilder\table\base_report_table.
|
inherited |
Override parent method of the same, to make use of a recordset and avoid issues with duplicate values in the first column.
| int | $pagesize | |
| bool | $useinitialsbar |
|
inherited |
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
| bool | $editing |