Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Static Public Member Functions | |
static | add_entry ($glossaryid, $concept, $definition, $definitionformat, $options=array()) |
Add a new entry to a given glossary. More... | |
static | add_entry_parameters () |
Returns the description of the external function parameters. More... | |
static | add_entry_returns () |
Returns the description of the external function return value. More... | |
static | call_external_function ($function, $args, $ajaxonly=false) |
Call an external function validating all params/returns correctly. More... | |
static | clean_returnvalue (external_description $description, $response) |
Clean response If a response attribute is unknown from the description, we just ignore the attribute. More... | |
static | external_function_info ($function, $strictness=MUST_EXIST) |
Returns detailed function information. More... | |
static | get_authors ($id, $from, $limit, $options) |
Get the authors of a glossary. More... | |
static | get_authors_parameters () |
Returns the description of the external function parameters. More... | |
static | get_authors_returns () |
Returns the description of the external function return value. More... | |
static | get_categories ($id, $from, $limit) |
Get the categories of a glossary. More... | |
static | get_categories_parameters () |
Returns the description of the external function parameters. More... | |
static | get_categories_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_author ($id, $letter, $field, $sort, $from, $limit, $options) |
Browse a glossary entries by author. More... | |
static | get_entries_by_author_id ($id, $authorid, $order, $sort, $from, $limit, $options) |
Browse a glossary entries by author. More... | |
static | get_entries_by_author_id_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_author_id_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_author_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_author_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_category ($id, $categoryid, $from, $limit, $options) |
Browse a glossary entries by category. More... | |
static | get_entries_by_category_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_category_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_date ($id, $order, $sort, $from, $limit, $options) |
Browse a glossary entries by date. More... | |
static | get_entries_by_date_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_date_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_letter ($id, $letter, $from, $limit, $options) |
Browse a glossary entries by letter. More... | |
static | get_entries_by_letter_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_letter_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_search ($id, $query, $fullsearch, $order, $sort, $from, $limit, $options) |
Browse a glossary entries using the search. More... | |
static | get_entries_by_search_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_search_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_by_term ($id, $term, $from, $limit, $options) |
Browse a glossary entries using a term matching the concept or alias. More... | |
static | get_entries_by_term_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_by_term_returns () |
Returns the description of the external function return value. More... | |
static | get_entries_to_approve ($id, $letter, $order, $sort, $from, $limit) |
Browse a glossary entries using a term matching the concept or alias. More... | |
static | get_entries_to_approve_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entries_to_approve_returns () |
Returns the description of the external function return value. More... | |
static | get_entry_by_id ($id) |
Get an entry. More... | |
static | get_entry_by_id_parameters () |
Returns the description of the external function parameters. More... | |
static | get_entry_by_id_returns () |
Returns the description of the external function return value. More... | |
static | get_glossaries_by_courses ($courseids=array()) |
Returns a list of glossaries in a provided list of courses. More... | |
static | get_glossaries_by_courses_parameters () |
Describes the parameters for get_glossaries_by_courses. More... | |
static | get_glossaries_by_courses_returns () |
Describes the get_glossaries_by_courses return value. More... | |
static | set_context_restriction ($context) |
Set context restriction for all following subsequent function calls. More... | |
static | set_timeout ($seconds=360) |
This method has to be called before every operation that takes a longer time to finish! More... | |
static | validate_context ($context) |
Makes sure user may execute functions in this context. More... | |
static | validate_parameters (external_description $description, $params) |
Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. More... | |
static | view_entry ($id) |
Notify that the entry was viewed. More... | |
static | view_entry_parameters () |
Returns the description of the external function parameters. More... | |
static | view_entry_returns () |
Returns the description of the external function return value. More... | |
static | view_glossary ($id, $mode) |
Notify that the course module was viewed. More... | |
static | view_glossary_parameters () |
Returns the description of the external function parameters. More... | |
static | view_glossary_returns () |
Returns the description of the external function return value. More... | |
Static Protected Member Functions | |
static | fill_entry_details ($entry, $context) |
Fill in an entry object. More... | |
static | get_browse_modes_from_display_format ($format) |
Get the browse modes from the display format. More... | |
static | get_context_from_params ($param) |
Get context from passed parameters. More... | |
static | get_context_parameters () |
Returns a prepared structure to use a context parameters. More... | |
static | get_entry_return_structure ($includecat=false) |
Get the return value of an entry. More... | |
static | validate_glossary ($id) |
Validate a glossary via ID. More... | |
|
static |
Add a new entry to a given glossary.
int | $glossaryid | the glosary id |
string | $concept | the glossary concept |
string | $definition | the concept definition |
int | $definitionformat | the concept definition format |
array | $options | additional settings |
array | Containing entry and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
staticinherited |
Call an external function validating all params/returns correctly.
Note that an external function may modify the state of the current page, so this wrapper saves and restores tha PAGE and COURSE global variables before/after calling the external function.
string | $function | A webservice function name. |
array | $args | Params array (named params) |
boolean | $ajaxonly | If true, an extra check will be peformed to see if ajax is required. |
array | containing keys for error (bool), exception and data. |
|
staticinherited |
Clean response If a response attribute is unknown from the description, we just ignore the attribute.
If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.
external_description | $description | description of the return values |
mixed | $response | the actual response |
mixed | response with added defaults for optional items, invalid_response_exception thrown if any problem found |
|
staticinherited |
Returns detailed function information.
string | object | $function | name of external function or record from external_function |
int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found |
stdClass | description or false if not found or exception thrown |
|
staticprotected |
Fill in an entry object.
This adds additional required fields for the external function to return.
stdClass | $entry | The entry. |
context | $context | The context the entry belongs to. |
void |
|
static |
Get the authors of a glossary.
int | $id | The glossary ID. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, authors and warnings. |
moodle_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
staticprotected |
Get the browse modes from the display format.
This returns some of the terms that can be used when reporting a glossary being viewed.
string | $format | The display format of the glossary. |
array | Containing some of all of the following: letter, cat, date, author. |
|
static |
Get the categories of a glossary.
int | $id | The glossary ID. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | Containing count, categories and warnings. |
moodle_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
staticprotectedinherited |
Get context from passed parameters.
The passed array must either contain a contextid or a combination of context level and instance id to fetch the context. For example, the context level can be "course" and instanceid can be courseid.
See context_helper::get_all_levels() for a list of valid context levels.
array | $param |
invalid_parameter_exception |
context |
|
staticprotectedinherited |
Returns a prepared structure to use a context parameters.
external_single_structure |
Reimplemented in core_competency\external, and tool_lp\external.
|
static |
Browse a glossary entries by author.
int | $id | The glossary ID. |
string | $letter | A letter, or a special keyword. |
string | $field | The field to search from. |
string | $sort | The direction of the order. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Browse a glossary entries by author.
int | $id | The glossary ID. |
int | $authorid | The author ID. |
string | $order | The way to order the results. |
string | $sort | The direction of the order. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries by category.
int | $id | The glossary ID. |
int | $categoryid | The category ID. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries by date.
int | $id | The glossary ID. |
string | $order | The way to order the records. |
string | $sort | The direction of the order. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries by letter.
int | $id | The glossary ID. |
string | $letter | A letter, or a special keyword. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries using the search.
int | $id | The glossary ID. |
string | $query | The search query. |
bool | $fullsearch | Whether or not full search is required. |
string | $order | The way to order the results. |
string | $sort | The direction of the order. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries using a term matching the concept or alias.
int | $id | The glossary ID. |
string | $term | The term. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | $options | Array of options. |
array | Containing count, entries and warnings. |
moodle_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Browse a glossary entries using a term matching the concept or alias.
int | $id | The glossary ID. |
string | $letter | A letter, or a special keyword. |
string | $order | The way to order the records. |
string | $sort | The direction of the order. |
int | $from | Start returning records from here. |
int | $limit | Number of records to return. |
array | Containing count, entries and warnings. |
moodle_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Get an entry.
int | $id | The entry ID. |
array | Containing entry and warnings. |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
staticprotected |
Get the return value of an entry.
bool | $includecat | Whether the definition should include category info. |
external_definition |
|
static |
Returns a list of glossaries in a provided list of courses.
If no list is provided all glossaries that the user can view will be returned.
array | $courseids | the course IDs. |
array | of glossaries |
|
static |
Describes the parameters for get_glossaries_by_courses.
external_function_parameters |
|
static |
Describes the get_glossaries_by_courses return value.
external_single_structure |
|
staticinherited |
Set context restriction for all following subsequent function calls.
stdClass | $context | the context restriction |
|
staticinherited |
This method has to be called before every operation that takes a longer time to finish!
int | $seconds | max expected time the next operation needs |
|
staticinherited |
Makes sure user may execute functions in this context.
stdClass | $context |
|
staticprotected |
Validate a glossary via ID.
int | $id | The glossary ID. |
array | Contains glossary, context, course and cm. |
|
staticinherited |
Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown.
This is a simple recursive method which is intended to be called from each implementation method of external API.
external_description | $description | description of parameters |
mixed | $params | the actual parameters |
mixed | params with added defaults for optional items, invalid_parameters_exception thrown if any problem found |
|
static |
Notify that the entry was viewed.
int | $id | The entry ID. |
array | of warnings and status result |
moodle_exception | |
invalid_parameter_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |
|
static |
Notify that the course module was viewed.
int | $id | The glossary instance ID. |
string | $mode | The view mode. |
array | of warnings and status result |
moodle_exception |
|
static |
Returns the description of the external function parameters.
external_function_parameters |
|
static |
Returns the description of the external function return value.
external_description |