Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Public Member Functions | |
add_join (string $join) | |
Add join clause required for this entity to join to existing tables/entities. | |
add_joins (array $joins) | |
Add multiple join clauses required for this entity {. | |
format ($value, stdClass $row, string $fieldname) | |
Formats the user field for display. | |
get_column (string $name) | |
Returns an entity column. | |
get_columns () | |
Returns entity columns. | |
get_condition (string $name) | |
Returns an entity condition. | |
get_conditions () | |
Returns entity conditions. | |
get_entity_name () | |
Return entity name. | |
get_entity_title () | |
Get entity title. | |
get_filter (string $name) | |
Returns an entity filter. | |
get_filters () | |
Returns entity filters. | |
get_identity_column (string $identityfield) | |
Returns column that corresponds to the given identity field, profile field identifiers will be converted to those used by the {. | |
get_identity_columns (context $context, array $excluding=[]) | |
Returns columns that correspond to the site configured identity fields. | |
get_identity_filter (string $identityfield) | |
Returns filter that corresponds to the given identity field, profile field identifiers will be converted to those used by the {. | |
get_identity_filters (context $context, array $excluding=[]) | |
Returns filters that correspond to the site configured identity fields. | |
get_joins () | |
Return entity joins. | |
get_table_alias (string $tablename) | |
Returns an alias used in the queries for a given table. | |
get_table_aliases () | |
Returns aliases used in the queries for all tables. | |
get_tag_joins () | |
Return joins necessary for retrieving tags. | |
has_table_join_alias (string $tablename) | |
Determine whether defined table join alias was specified. | |
initialise () | |
Initialise the entity, add all user fields and all 'visible' user profile fields. | |
set_entity_name (string $entityname) | |
Set entity name. | |
set_entity_title (lang_string $title) | |
Set entity title. | |
set_table_alias (string $tablename, string $alias) | |
Override the default alias for given database table used in entity queries, for instance when the same table is used by multiple entities and you want them each to refer to it by the same alias. | |
set_table_aliases (array $aliases) | |
Override multiple default database table aliases used in entity queries as per {. | |
set_table_join_alias (string $tablename, string $alias) | |
Set the alias for given database table that has already been added to the report. | |
Static Public Member Functions | |
static | get_name_fields_select (string $usertablealias='u') |
Returns a SQL statement to select all user fields necessary for fullname() function. | |
static | get_options_for_auth () |
List of options for the field auth. | |
static | get_options_for_country () |
List of options for the field country. | |
static | get_options_for_lang () |
List of options for the field lang. | |
static | get_options_for_theme () |
List of options for the field theme. | |
static | get_options_for_timezone () |
List of options for the field timezone. | |
Protected Member Functions | |
add_column (column $column) | |
Add a column to the entity. | |
add_condition (filter $condition) | |
Add a condition to the entity. | |
add_filter (filter $filter) | |
Add a filter to the entity. | |
get_all_columns () | |
Returns list of all available columns. | |
get_all_filters () | |
Return list of all available filters. | |
get_default_entity_title () | |
The default title for this entity. | |
get_default_table_aliases () | |
Database tables that this entity uses and their default aliases (note that these aliases are now ignored) | |
get_default_tables () | |
Database tables that this entity uses. | |
get_options_for (string $fieldname) | |
Gets list of options if the filter supports it. | |
get_tag_joins_for_entity (string $component, string $itemtype, string $itemidfield) | |
Helper method for returning joins necessary for retrieving tags related to the current entity. | |
get_user_field_type (string $userfield) | |
Return appropriate column type for given user field. | |
get_user_fields () | |
User fields. | |
get_user_profile_fields () | |
Get user profile fields helper instance. | |
is_sortable (string $fieldname) | |
Check if this field is sortable. | |
|
finalprotectedinherited |
Add a column to the entity.
column | $column |
self |
|
finalprotectedinherited |
Add a condition to the entity.
filter | $condition |
$this |
|
finalprotectedinherited |
Add a filter to the entity.
filter | $filter |
self |
|
finalinherited |
Add join clause required for this entity to join to existing tables/entities.
string | $join |
self |
|
finalinherited |
Add multiple join clauses required for this entity {.
string[] | $joins |
self |
core_reportbuilder\local\entities\user::format | ( | $value, | |
stdClass | $row, | ||
string | $fieldname ) |
Formats the user field for display.
mixed | $value | Current field value. |
stdClass | $row | Complete row. |
string | $fieldname | Name of the field to format. |
string |
|
protected |
Returns list of all available columns.
These are all the columns available to use in any report that uses this entity.
column[] |
|
protected |
Return list of all available filters.
filter[] |
|
finalinherited |
Returns an entity column.
string | $name |
column |
coding_exception | For invalid column name |
|
finalinherited |
Returns entity columns.
column[] |
|
finalinherited |
Returns an entity condition.
string | $name |
filter |
coding_exception | For invalid condition name |
|
finalinherited |
Returns entity conditions.
filter[] |
|
protected |
The default title for this entity.
lang_string |
Reimplemented from core_reportbuilder\local\entities\base.
|
protectedinherited |
Database tables that this entity uses and their default aliases (note that these aliases are now ignored)
string[] | Array of $tablename => $alias |
|
protected |
Database tables that this entity uses.
string[] |
Reimplemented from core_reportbuilder\local\entities\base.
|
finalinherited |
Return entity name.
string |
|
finalinherited |
Get entity title.
lang_string |
|
finalinherited |
Returns an entity filter.
string | $name |
filter |
coding_exception | For invalid filter name |
|
finalinherited |
Returns entity filters.
filter[] |
core_reportbuilder\local\entities\user::get_identity_column | ( | string | $identityfield | ) |
Returns column that corresponds to the given identity field, profile field identifiers will be converted to those used by the {.
string | $identityfield | Field from the user table, or a custom profile field |
column |
core_reportbuilder\local\entities\user::get_identity_columns | ( | context | $context, |
array | $excluding = [] ) |
Returns columns that correspond to the site configured identity fields.
context | $context | |
string[] | $excluding |
column[] |
core_reportbuilder\local\entities\user::get_identity_filter | ( | string | $identityfield | ) |
Returns filter that corresponds to the given identity field, profile field identifiers will be converted to those used by the {.
string | $identityfield | Field from the user table, or a custom profile field |
filter |
core_reportbuilder\local\entities\user::get_identity_filters | ( | context | $context, |
array | $excluding = [] ) |
Returns filters that correspond to the site configured identity fields.
context | $context | |
string[] | $excluding |
filter[] |
|
finalinherited |
Return entity joins.
string[] |
|
static |
Returns a SQL statement to select all user fields necessary for fullname() function.
Note the implementation here is similar to {
string | $usertablealias |
string |
|
protected |
Gets list of options if the filter supports it.
string | $fieldname |
null|array |
|
static |
List of options for the field auth.
string[] |
|
static |
List of options for the field country.
string[] |
|
static |
List of options for the field lang.
string[] |
|
static |
List of options for the field theme.
string[] |
|
static |
List of options for the field timezone.
string[] |
|
finalinherited |
Returns an alias used in the queries for a given table.
string | $tablename | One of the tables set by { |
string |
coding_exception | For invalid table name |
|
finalinherited |
Returns aliases used in the queries for all tables.
string[] |
core_reportbuilder\local\entities\user::get_tag_joins | ( | ) |
Return joins necessary for retrieving tags.
string[] |
|
finalprotectedinherited |
Helper method for returning joins necessary for retrieving tags related to the current entity.
Both 'tag' and 'tag_instance' aliases must be returned by the entity {
string | $component | |
string | $itemtype | |
string | $itemidfield |
string[] |
|
protected |
Return appropriate column type for given user field.
string | $userfield |
int |
|
protected |
User fields.
lang_string[] |
|
protected |
Get user profile fields helper instance.
user_profile_fields |
|
finalinherited |
Determine whether defined table join alias was specified.
Call {
string | $tablename |
bool |
core_reportbuilder\local\entities\user::initialise | ( | ) |
Initialise the entity, add all user fields and all 'visible' user profile fields.
base |
Reimplemented from core_reportbuilder\local\entities\base.
|
protected |
Check if this field is sortable.
string | $fieldname |
bool |
|
finalinherited |
Set entity name.
string | $entityname |
self |
|
finalinherited |
|
finalinherited |
Override the default alias for given database table used in entity queries, for instance when the same table is used by multiple entities and you want them each to refer to it by the same alias.
string | $tablename | One of the tables set by { |
string | $alias |
self |
coding_exception | For invalid table name |
|
finalinherited |
Override multiple default database table aliases used in entity queries as per {.
array | $aliases | Array of tablename => alias values |
self |
|
finalinherited |
Set the alias for given database table that has already been added to the report.
Enables entities to avoid additional joins on the same table by allowing re-use of existing table aliases in their own queries, {
string | $tablename | |
string | $alias |
self |