Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
add_action (action $action) | |
Adds an action to the report. | |
add_action_divider () | |
Adds action divider to the report. | |
add_attributes (array $attributes) | |
Add report attributes (data-, class, etc.) that will be included in HTML when report is displayed. | |
add_base_condition_simple (string $fieldname, $fieldvalue) | |
Define simple "field = value" clause to apply to the report query. | |
add_base_condition_sql (string $where, array $params=[]) | |
Define more complex/non-empty clause to apply to the report query. | |
add_columns () | |
Adds the columns we want to display in the report. | |
can_be_downloaded () | |
Validates access to download this report. | |
get_actions () | |
Return report actions. | |
get_active_columns () | |
Return all active report columns (by default, all available columns) | |
get_active_columns_by_alias () | |
Return all active report columns, keyed by their alias (only active columns in a report would have a valid alias/index) | |
get_active_conditions () | |
Return all active report conditions (by default, all available conditions) | |
get_active_filters () | |
Return all active report filters (by default, all available filters) | |
get_applied_filter_count () | |
Return the number of filter instances that are being applied based on the report's filter values (i.e. | |
get_attributes () | |
Returns the report HTML attributes. | |
get_base_condition () | |
Return base select/params for the report query. | |
get_base_fields () | |
Return report base fields. | |
get_checkbox_toggleall (bool $ismaster, ?stdClass $row=null) | |
Return instance of toggle all checkbox, if previously defined by {. | |
get_column (string $uniqueidentifier) | |
Return report column by unique identifier. | |
get_columns () | |
Return all available report columns. | |
get_condition (string $uniqueidentifier) | |
Return report condition by unique identifier. | |
get_condition_instances () | |
Return all active report condition instances. | |
get_condition_values () | |
Get the condition values of the report. | |
get_conditions () | |
Return all available report conditions. | |
get_context () | |
Returns the report context. | |
get_default_no_results_notice () | |
Get the default lang string for the notice used when no results are found. | |
get_default_per_page () | |
Default 'per page' size. | |
get_downloadfilename () | |
Return the downloadable report filename. | |
get_entity_title (string $name) | |
Returns title of given report entity. | |
get_exclude_columns_for_download () | |
Return list of column names that will be excluded when table is downloaded. | |
get_filter (string $uniqueidentifier) | |
Return report filter by unique identifier. | |
get_filter_form_default () | |
Whether to use the default filters form. | |
get_filter_instances () | |
Return all active report filter instances. | |
get_filter_values () | |
Get the filter values of the report. | |
get_filters () | |
Return all available report filters. | |
get_initial_sort_column () | |
Get initial sort column. | |
get_initial_sort_direction () | |
Get initial sort column direction. | |
get_joins () | |
Return report JOIN clauses. | |
get_main_table () | |
Get the main table name. | |
get_main_table_alias () | |
Get the alias for the main table. | |
get_parameter (string $param, $default, string $type) | |
Return specific report parameter. | |
get_parameters () | |
Return all report parameters. | |
get_report_persistent () | |
Returns persistent class used when initialising this report. | |
get_row_class (stdClass $row) | |
CSS classes to add to the row. | |
get_settings_values () | |
Get the settings values of the report. | |
has_actions () | |
Whether report has any actions. | |
is_downloadable () | |
Get if the report can be downloaded. | |
output () | |
Output the report. | |
require_can_view () | |
Validate access to the report. | |
row_callback (stdClass $row) | |
Called before rendering each row. | |
set_condition_values (array $values) | |
Set the condition values of the report. | |
set_default_no_results_notice (?lang_string $notice) | |
Set the default lang string for the notice used when no results are found. | |
set_default_per_page (int $defaultperpage) | |
Set the default 'per page' size. | |
set_downloadable (bool $downloadable, ?string $downloadfilename=null) | |
Set if the report can be downloaded. | |
set_filter_form_default (bool $filterformdefault=true) | |
Override whether to use the default system report filters form, for instance this can be disabled if the UI requires it's own custom filter management form for a specific report. | |
set_filter_values (array $values) | |
Set the filter values of the report. | |
set_initial_sort_column (string $uniqueidentifier, int $sortdirection) | |
Set initial sort column and sort direction for the report. | |
set_main_table (string $tablename, string $tablealias='') | |
Set the main table and alias for the SQL query. | |
set_parameters (array $parameters) | |
Set all report parameters. | |
set_settings_values (array $values) | |
Set the settings values of the report. | |
Static Public Member Functions | |
static | get_name () |
Provide default implementation of the report name. | |
static | is_available () |
Get the report availability. | |
Public Attributes | |
int const | DEFAULT_PAGESIZE = 30 |
Default paging limit. | |
int const | TYPE_CUSTOM_REPORT = 0 |
Custom report type value. | |
int const | TYPE_SYSTEM_REPORT = 1 |
System report type value. | |
Protected Member Functions | |
add_base_fields (string $sql) | |
Add list of fields that have to be always included in SQL query for actions and row classes. | |
add_column (column $column) | |
Adds a column to the report. | |
add_column_from_entity (string $uniqueidentifier) | |
Add given column to the report from an entity. | |
add_columns_from_entities (array $columns) | |
Add given columns to the report from one or more entities. | |
add_condition (filter $condition) | |
Adds a condition to the report. | |
add_condition_from_entity (string $uniqueidentifier) | |
Add given condition to the report from an entity. | |
add_conditions_from_entities (array $conditions) | |
Add given conditions to the report from one or more entities. | |
add_entity (entity_base $entity) | |
Adds given entity, along with it's columns and filters, to the report. | |
add_filter (filter $filter) | |
Adds a filter to the report. | |
add_filter_from_entity (string $uniqueidentifier) | |
Add given filter to the report from an entity. | |
add_filters () | |
Adds the filters we want to display in the report. | |
add_filters_from_entities (array $filters) | |
Add given filters to the report from one or more entities. | |
add_join (string $join, array $params=[], bool $validateparams=true) | |
Adds report JOIN clause that is always added. | |
annotate_entity (string $name, lang_string $title) | |
Define a new entity for the report. | |
can_view () | |
Validates access to view this report. | |
get_entities () | |
Returns the list of all the entities added to the report. | |
get_entity (string $name) | |
Returns the entity added to the report from the given entity name. | |
initialise () | |
Initialise report, we need to set the main table, load our entities and set columns/filters. | |
set_checkbox_toggleall (callable $callback) | |
Define toggle all checkbox for the report, required row data should be defined by calling {. | |
validate () | |
Report validation. | |
|
finalinherited |
Adds an action to the report.
action | $action |
|
inherited |
Add report attributes (data-, class, etc.) that will be included in HTML when report is displayed.
array | $attributes |
self |
|
finalinherited |
Define simple "field = value" clause to apply to the report query.
string | $fieldname | |
mixed | $fieldvalue |
|
finalinherited |
Define more complex/non-empty clause to apply to the report query.
string | $where | |
array | $params | Note that the param names should be generated by { |
|
finalprotectedinherited |
Add list of fields that have to be always included in SQL query for actions and row classes.
Base fields are only available in system reports because they are not compatible with aggregation
string | $sql | SQL clause for the list of fields that only uses main table or base joins |
|
finalprotectedinherited |
Adds a column to the report.
column | $column |
column |
coding_exception |
|
finalprotectedinherited |
Add given column to the report from an entity.
The entity must have already been added to the report before calling this method
string | $uniqueidentifier |
column |
gradereport_summary\local\systemreports\summary::add_columns | ( | ) |
Adds the columns we want to display in the report.
They are all provided by the entities we previously added in the {
|
finalprotectedinherited |
Add given columns to the report from one or more entities.
Each entity must have already been added to the report before calling this method
string[] | $columns | Unique identifier of each entity column |
|
finalprotectedinherited |
Adds a condition to the report.
filter | $condition |
filter |
coding_exception |
|
finalprotectedinherited |
Add given condition to the report from an entity.
The entity must have already been added to the report before calling this method
string | $uniqueidentifier |
filter |
|
finalprotectedinherited |
Add given conditions to the report from one or more entities.
Each entity must have already been added to the report before calling this method
string[] | $conditions | Unique identifier of each entity condition |
|
finalprotectedinherited |
Adds given entity, along with it's columns and filters, to the report.
entity_base | $entity |
|
finalprotectedinherited |
Adds a filter to the report.
filter | $filter |
filter |
coding_exception |
|
finalprotectedinherited |
Add given filter to the report from an entity.
The entity must have already been added to the report before calling this method
string | $uniqueidentifier |
filter |
|
protected |
Adds the filters we want to display in the report.
They are all provided by the entities we previously added in the {
|
finalprotectedinherited |
Add given filters to the report from one or more entities.
Each entity must have already been added to the report before calling this method
string[] | $filters | Unique identifier of each entity filter |
|
protectedinherited |
Adds report JOIN clause that is always added.
string | $join | |
array | $params | |
bool | $validateparams | Some queries might add non-standard params and validation could fail |
|
finalprotectedinherited |
Define a new entity for the report.
string | $name | |
lang_string | $title |
coding_exception |
|
finalinherited |
Validates access to download this report.
bool |
|
protected |
Validates access to view this report.
bool |
Reimplemented from core_reportbuilder\system_report.
|
finalinherited |
Return report actions.
action|action_menu_filler[] |
|
inherited |
Return all active report columns (by default, all available columns)
column[] |
Reimplemented in core_reportbuilder\datasource.
|
finalinherited |
Return all active report columns, keyed by their alias (only active columns in a report would have a valid alias/index)
column[] |
|
inherited |
Return all active report conditions (by default, all available conditions)
filter[] |
Reimplemented in core_reportbuilder\datasource.
|
inherited |
Return all active report filters (by default, all available filters)
filter[] |
Reimplemented in core_reportbuilder\datasource.
|
finalinherited |
Return the number of filter instances that are being applied based on the report's filter values (i.e.
user has configured them from their initial "Any value" state)
int |
|
inherited |
Returns the report HTML attributes.
array |
|
finalinherited |
Return base select/params for the report query.
array | [string $select, array $params] |
|
finalinherited |
Return report base fields.
array |
|
finalinherited |
Return instance of toggle all checkbox, if previously defined by {.
bool | $ismaster | |
stdClass | null | $row |
checkbox_toggleall|null |
|
finalinherited |
Return report column by unique identifier.
string | $uniqueidentifier |
column|null |
|
finalinherited |
Return all available report columns.
column[] |
|
finalinherited |
Return report condition by unique identifier.
string | $uniqueidentifier |
filter|null |
|
finalinherited |
Return all active report condition instances.
filter_base[] |
|
finalinherited |
Get the condition values of the report.
array |
|
finalinherited |
Return all available report conditions.
filter[] |
|
inherited |
Returns the report context.
context |
|
inherited |
Get the default lang string for the notice used when no results are found.
lang_string|null | the lang_string instance or null if the report prefers not to use one. |
|
inherited |
Default 'per page' size.
int |
|
finalinherited |
Return the downloadable report filename.
string |
|
finalprotectedinherited |
Returns the list of all the entities added to the report.
entity_base[] |
|
finalprotectedinherited |
Returns the entity added to the report from the given entity name.
string | $name |
entity_base |
coding_exception |
|
finalinherited |
Returns title of given report entity.
string | $name |
lang_string |
coding_exception |
|
inherited |
Return list of column names that will be excluded when table is downloaded.
Extending classes should override this method as appropriate
string[] | Array of column unique identifiers |
|
finalinherited |
Return report filter by unique identifier.
string | $uniqueidentifier |
filter|null |
|
finalinherited |
Whether to use the default filters form.
bool |
|
finalinherited |
Return all active report filter instances.
filter_base[] |
|
finalinherited |
Get the filter values of the report.
array |
|
finalinherited |
Return all available report filters.
filter[] |
|
inherited |
Get initial sort column.
column|null |
|
inherited |
Get initial sort column direction.
int |
|
inherited |
Return report JOIN clauses.
array |
|
finalinherited |
Get the main table name.
string |
|
finalinherited |
Get the alias for the main table.
string |
|
staticinherited |
Provide default implementation of the report name.
Extending classes can implement this method to provide their own name
string |
Reimplemented from core_reportbuilder\local\report\base.
Reimplemented in core_admin\reportbuilder\local\systemreports\task_logs.
|
finalinherited |
Return specific report parameter.
string | $param | |
mixed | $default | |
string | $type |
mixed |
|
finalinherited |
Return all report parameters.
array |
|
finalinherited |
Returns persistent class used when initialising this report.
report |
|
inherited |
CSS classes to add to the row.
Can be overridden by system reports do define class to be added to output according to content of each row
stdClass | $row |
string |
Reimplemented in core_badges\reportbuilder\local\systemreports\badges, core_cohort\reportbuilder\local\systemreports\cohorts, core_reportbuilder\local\systemreports\report_schedules, core_reportbuilder\local\systemreports\reports_list, and core_tag\reportbuilder\local\systemreports\tags.
|
finalinherited |
Get the settings values of the report.
array |
|
finalinherited |
Whether report has any actions.
bool |
|
protected |
Initialise report, we need to set the main table, load our entities and set columns/filters.
Reimplemented from core_reportbuilder\local\report\base.
|
staticinherited |
Get the report availability.
Sub-classes should override this method to declare themselves unavailable, for example if they require classes that aren't present due to missing plugin
bool |
|
finalinherited |
Get if the report can be downloaded.
bool |
|
finalinherited |
Output the report.
@uses core_reportbuilder\output\renderer\render_system_report()
string |
|
finalinherited |
Validate access to the report.
report_access_exception |
|
inherited |
Called before rendering each row.
Can be overridden to pre-fetch/create objects and store them in the class, which can later be used in column and action callbacks
stdClass | $row |
|
finalprotectedinherited |
Define toggle all checkbox for the report, required row data should be defined by calling {.
callable | $callback | Callback to return value/label for each checkbox, implementing the following signature: function(stdClass $row): array containing value/label pair |
|
finalinherited |
Set the condition values of the report.
array | $values |
bool |
|
inherited |
Set the default lang string for the notice used when no results are found.
lang_string | null | $notice | string, or null to tell the report to omit the notice entirely. |
void |
|
inherited |
Set the default 'per page' size.
int | $defaultperpage |
|
finalinherited |
Set if the report can be downloaded.
bool | $downloadable | |
string | null | $downloadfilename | If downloadable, then the name of the file (defaults to the name of the current report) |
|
finalinherited |
Override whether to use the default system report filters form, for instance this can be disabled if the UI requires it's own custom filter management form for a specific report.
bool | $filterformdefault |
|
finalinherited |
Set the filter values of the report.
array | $values |
bool |
|
inherited |
Set initial sort column and sort direction for the report.
string | $uniqueidentifier | |
int | $sortdirection | One of SORT_ASC or SORT_DESC |
coding_exception |
|
finalinherited |
Set the main table and alias for the SQL query.
string | $tablename | |
string | $tablealias |
|
finalinherited |
Set all report parameters.
array | $parameters |
|
finalinherited |
Set the settings values of the report.
array | $values |
bool |
|
protectedinherited |
Report validation.
report_access_exception | If user cannot access the report |
coding_exception | If no default column are specified |
Reimplemented from core_reportbuilder\local\report\base.