Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Public Member Functions | |
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_default_columns () | |
Add default datasource columns to the report. | |
add_default_conditions () | |
Add default datasource conditions to the report. | |
add_default_filters () | |
Add default datasource filters to the report. | |
get_active_columns () | |
Override parent method, returning only those columns specifically added to the custom report (rather than all that are available) | |
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 () | |
Override parent method, returning only those conditions specifically added to the custom report (rather than all that are available) | |
get_active_filters () | |
Override parent method, returning only those filters specifically added to the custom report (rather than all that are available) | |
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_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_column_sorting () | |
Return the column sorting that will be added to the report upon creation. | |
get_default_columns () | |
Return the columns that will be added to the report upon creation. | |
get_default_condition_values () | |
Return the default condition values that will be added to the report once is created. | |
get_default_conditions () | |
Return the conditions that will be added to the report upon creation. | |
get_default_filters () | |
Return the filters that will be added to the report upon creation. | |
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_filter (string $uniqueidentifier) | |
Return report filter by unique identifier. | |
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_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_report_persistent () | |
Returns persistent class used when initialising this report. | |
get_settings_values () | |
Get the settings values of the report. | |
is_downloadable () | |
Get if the report can be downloaded. | |
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_values (array $values) | |
Set the filter values of the report. | |
set_main_table (string $tablename, string $tablealias='') | |
Set the main table and alias for the SQL query. | |
set_settings_values (array $values) | |
Set the settings values of the report. | |
Static Public Member Functions | |
static | get_name () |
Return user friendly name of the report source. | |
static | is_available () |
Get the report availability. | |
static | report_elements_modified (int $reportid) |
Indicate that report elements have been modified, e.g. | |
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_all_from_entities () | |
Adds all columns/filters/conditions from all the entities added to the report at once. | |
add_all_from_entity (string $entityname) | |
Adds all columns/filters/conditions from the given entity to the report at once. | |
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_columns_from_entity (string $entityname, array $include=[], array $exclude=[]) | |
Add columns from the given entity name to be available to use in a custom report. | |
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_conditions_from_entity (string $entityname, array $include=[], array $exclude=[]) | |
Add conditions from the given entity name to be available to use in a custom report. | |
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_from_entities (array $filters) | |
Add given filters to the report from one or more entities. | |
add_filters_from_entity (string $entityname, array $include=[], array $exclude=[]) | |
Add filters from the given entity name to be available to use in a custom report. | |
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. | |
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. | |
validate () | |
Perform some basic validation about expected class properties. | |
|
finalprotectedinherited |
Adds all columns/filters/conditions from the given entity to the report at once.
string | $entityname |
|
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 |
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 |
|
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 |
Add columns from the given entity name to be available to use in a custom report.
string | $entityname | |
array | $include | Include only these columns, if omitted then include all |
array | $exclude | Exclude these columns, if omitted then exclude none |
coding_exception | If both $include and $exclude are non-empty |
|
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 |
Add conditions from the given entity name to be available to use in a custom report.
string | $entityname | |
array | $include | Include only these conditions, if omitted then include all |
array | $exclude | Exclude these conditions, if omitted then exclude none |
coding_exception | If both $include and $exclude are non-empty |
|
inherited |
Add default datasource columns to the report.
Uses column data returned by the source {
coding_exception | If default column sorting refers to an invalid column |
|
inherited |
Add default datasource conditions to the report.
This method is optional and can be called when the report is created to add the default conditions defined in the selected datasource.
|
inherited |
Add default datasource filters to the report.
This method is optional and can be called when the report is created to add the default filters defined in the selected datasource.
|
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 |
|
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 |
|
finalprotectedinherited |
Add filters from the given entity name to be available to use in a custom report.
string | $entityname | |
array | $include | Include only these filters, if omitted then include all |
array | $exclude | Exclude these filters, if omitted then exclude none |
coding_exception | If both $include and $exclude are non-empty |
|
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 |
|
inherited |
Override parent method, returning only those columns specifically added to the custom report (rather than all that are available)
column[] |
Reimplemented from core_reportbuilder\local\report\base.
|
finalinherited |
Return all active report columns, keyed by their alias (only active columns in a report would have a valid alias/index)
column[] |
|
inherited |
Override parent method, returning only those conditions specifically added to the custom report (rather than all that are available)
filter[] |
Reimplemented from core_reportbuilder\local\report\base.
|
inherited |
Override parent method, returning only those filters specifically added to the custom report (rather than all that are available)
filter[] |
Reimplemented from core_reportbuilder\local\report\base.
|
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 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 |
core_comment\reportbuilder\datasource\comments::get_default_column_sorting | ( | ) |
Return the column sorting that will be added to the report upon creation.
int[] |
Reimplemented from core_reportbuilder\datasource.
core_comment\reportbuilder\datasource\comments::get_default_columns | ( | ) |
Return the columns that will be added to the report upon creation.
string[] |
Reimplemented from core_reportbuilder\datasource.
|
inherited |
Return the default condition values that will be added to the report once is created.
For any of the default conditions returned by the method {
array |
Reimplemented in core_admin\reportbuilder\datasource\task_logs, core_course\reportbuilder\datasource\participants, core_files\reportbuilder\datasource\files, and core_user\reportbuilder\datasource\users.
core_comment\reportbuilder\datasource\comments::get_default_conditions | ( | ) |
Return the conditions that will be added to the report upon creation.
string[] |
Reimplemented from core_reportbuilder\datasource.
core_comment\reportbuilder\datasource\comments::get_default_filters | ( | ) |
Return the filters that will be added to the report upon creation.
string[] |
Reimplemented from core_reportbuilder\datasource.
|
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 |
|
finalinherited |
Return report filter by unique identifier.
string | $uniqueidentifier |
filter|null |
|
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 |
Return report JOIN clauses.
array |
|
finalinherited |
Get the main table name.
string |
|
finalinherited |
Get the alias for the main table.
string |
|
static |
Return user friendly name of the report source.
string |
Reimplemented from core_reportbuilder\local\report\base.
|
finalinherited |
Returns persistent class used when initialising this report.
report |
|
finalinherited |
Get the settings values of the report.
array |
|
protected |
Initialise report.
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 |
|
staticfinalinherited |
Indicate that report elements have been modified, e.g.
columns/filters/conditions have been added, removed or updated
int | $reportid |
|
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 |
Set the filter values of the report.
array | $values |
bool |
|
finalinherited |
Set the main table and alias for the SQL query.
string | $tablename | |
string | $tablealias |
|
finalinherited |
Set the settings values of the report.
array | $values |
bool |
|
protectedinherited |
Perform some basic validation about expected class properties.
coding_exception |
Reimplemented in core_reportbuilder\system_report.