Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Class external. More...
Static Public Member Functions | |
static | approve_data_request ($requestid) |
Approve a data request. More... | |
static | approve_data_request_parameters () |
Parameter description for approve_data_request(). More... | |
static | approve_data_request_returns () |
Parameter description for approve_data_request(). More... | |
static | bulk_approve_data_requests ($requestids) |
Bulk approve bulk data request. More... | |
static | bulk_approve_data_requests_parameters () |
Parameter description for bulk_approve_data_requests(). More... | |
static | bulk_approve_data_requests_returns () |
Parameter description for bulk_approve_data_requests(). More... | |
static | bulk_deny_data_requests ($requestids) |
Bulk deny data requests. More... | |
static | bulk_deny_data_requests_parameters () |
Parameter description for bulk_deny_data_requests(). More... | |
static | bulk_deny_data_requests_returns () |
Parameter description for bulk_deny_data_requests(). More... | |
static | call_external_function ($function, $args, $ajaxonly=false) |
Call an external function validating all params/returns correctly. More... | |
static | cancel_data_request ($requestid) |
Cancel a data request. More... | |
static | cancel_data_request_parameters () |
Parameter description for cancel_data_request(). More... | |
static | cancel_data_request_returns () |
Parameter description for cancel_data_request(). 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 | confirm_contexts_for_deletion ($ids) |
Confirm a given array of expired context record IDs. More... | |
static | confirm_contexts_for_deletion_parameters () |
Parameters for confirm_contexts_for_deletion(). More... | |
static | confirm_contexts_for_deletion_returns () |
Returns for confirm_contexts_for_deletion(). More... | |
static | contact_dpo ($message) |
Make a general enquiry to a DPO. More... | |
static | contact_dpo_parameters () |
Parameter description for contact_dpo(). More... | |
static | contact_dpo_returns () |
Parameter description for contact_dpo(). More... | |
static | create_category_form ($jsonformdata) |
Creates a data category from form data. More... | |
static | create_category_form_parameters () |
Parameter description for create_category_form(). More... | |
static | create_category_form_returns () |
Returns for create_category_form(). More... | |
static | create_purpose_form ($jsonformdata) |
Creates a data purpose from form data. More... | |
static | create_purpose_form_parameters () |
Parameter description for create_purpose_form(). More... | |
static | create_purpose_form_returns () |
Returns for create_purpose_form(). More... | |
static | delete_category ($id) |
Deletes a data category. More... | |
static | delete_category_parameters () |
Parameter description for delete_category(). More... | |
static | delete_category_returns () |
Parameter description for delete_category(). More... | |
static | delete_purpose ($id) |
Deletes a data purpose. More... | |
static | delete_purpose_parameters () |
Parameter description for delete_purpose(). More... | |
static | delete_purpose_returns () |
Parameter description for delete_purpose(). More... | |
static | deny_data_request ($requestid) |
Deny a data request. More... | |
static | deny_data_request_parameters () |
Parameter description for deny_data_request(). More... | |
static | deny_data_request_returns () |
Parameter description for deny_data_request(). More... | |
static | external_function_info ($function, $strictness=MUST_EXIST) |
Returns detailed function information. More... | |
static | get_activity_options ($nodefaults) |
Fetches a list of activity options for setting data registry defaults. More... | |
static | get_activity_options_parameters () |
Parameters for get_activity_options(). More... | |
static | get_activity_options_returns () |
Returns for get_category_options(). More... | |
static | get_category_options ($includeinherit, $includenotset) |
Fetches a list of data category options containing category IDs as keys and the category name for the value. More... | |
static | get_category_options_parameters () |
Parameters for get_category_options(). More... | |
static | get_category_options_returns () |
Returns for get_category_options(). More... | |
static | get_data_request ($requestid) |
Fetch the details of a user's data request. More... | |
static | get_data_request_parameters () |
Parameter description for get_data_request(). More... | |
static | get_data_request_returns () |
Parameter description for get_data_request(). More... | |
static | get_purpose_options ($includeinherit, $includenotset) |
Fetches a list of data storage purposes containing purpose IDs as keys and the purpose name for the value. More... | |
static | get_purpose_options_parameters () |
Parameters for get_purpose_options(). More... | |
static | get_purpose_options_returns () |
Returns for get_purpose_options(). More... | |
static | get_users ($query) |
Fetch the details of a user's data request. More... | |
static | get_users_parameters () |
Parameter description for get_data_request(). More... | |
static | get_users_returns () |
Parameter description for get_users(). More... | |
static | mark_complete ($requestid) |
Mark a user's general enquiry's status as complete. More... | |
static | mark_complete_parameters () |
Parameter description for mark_complete(). More... | |
static | mark_complete_returns () |
Parameter description for mark_complete(). More... | |
static | set_context_defaults ($contextlevel, $category, $purpose, $activity, $override) |
Updates the default category and purpose for a given context level (and optionally, a plugin). More... | |
static | set_context_defaults_parameters () |
Parameters for set_context_defaults(). More... | |
static | set_context_defaults_returns () |
Returns for set_context_defaults(). More... | |
static | set_context_form ($jsonformdata) |
Creates a data category from form data. More... | |
static | set_context_form_parameters () |
Parameter description for set_context_form(). More... | |
static | set_context_form_returns () |
Returns for set_context_form(). More... | |
static | set_context_restriction ($context) |
Set context restriction for all following subsequent function calls. More... | |
static | set_contextlevel_form ($jsonformdata) |
Creates a data category from form data. More... | |
static | set_contextlevel_form_parameters () |
Parameter description for set_contextlevel_form(). More... | |
static | set_contextlevel_form_returns () |
Returns for set_contextlevel_form(). More... | |
static | set_timeout ($seconds=360) |
This method has to be called before every operation that takes a longer time to finish! More... | |
static | tree_extra_branches ($contextid, $element) |
Returns tree extra branches. More... | |
static | tree_extra_branches_parameters () |
Parameter description for tree_extra_branches(). More... | |
static | tree_extra_branches_returns () |
Returns for tree_extra_branches(). 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 Protected Member Functions | |
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... | |
Class external.
The external API for the Data Privacy tool.
|
static |
Approve a data request.
int | $requestid | The request ID. |
array |
|
static |
Parameter description for approve_data_request().
external_function_parameters |
|
static |
Parameter description for approve_data_request().
external_description |
|
static |
Bulk approve bulk data request.
array | $requestids | Array consisting the request ID's. |
array |
|
static |
Parameter description for bulk_approve_data_requests().
external_function_parameters |
|
static |
Parameter description for bulk_approve_data_requests().
external_description |
|
static |
Bulk deny data requests.
array | $requestids | Array consisting of request ID's. |
array |
|
static |
Parameter description for bulk_deny_data_requests().
external_function_parameters |
|
static |
Parameter description for bulk_deny_data_requests().
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. |
|
static |
Cancel a data request.
int | $requestid | The request ID. |
array |
invalid_persistent_exception | |
coding_exception | |
invalid_parameter_exception | |
restricted_context_exception |
|
static |
Parameter description for cancel_data_request().
external_function_parameters |
|
static |
|
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 |
|
static |
Confirm a given array of expired context record IDs.
int[] | $ids | Array of record IDs from the expired contexts table. |
array |
|
static |
Parameters for confirm_contexts_for_deletion().
external_function_parameters |
|
static |
Returns for confirm_contexts_for_deletion().
external_single_structure |
|
static |
Make a general enquiry to a DPO.
string | $message | The message to be sent to the DPO. |
array |
coding_exception | |
invalid_parameter_exception | |
invalid_persistent_exception | |
restricted_context_exception | |
dml_exception | |
moodle_exception |
|
static |
|
static |
|
static |
Creates a data category from form data.
string | $jsonformdata |
array |
|
static |
Parameter description for create_category_form().
external_function_parameters |
|
static |
|
static |
Creates a data purpose from form data.
string | $jsonformdata |
array |
|
static |
Parameter description for create_purpose_form().
external_function_parameters |
|
static |
|
static |
Deletes a data category.
int | $id | The ID. |
array |
invalid_persistent_exception | |
coding_exception | |
invalid_parameter_exception |
|
static |
Parameter description for delete_category().
external_function_parameters |
|
static |
Parameter description for delete_category().
external_single_structure |
|
static |
Deletes a data purpose.
int | $id | The ID. |
array |
invalid_persistent_exception | |
coding_exception | |
invalid_parameter_exception |
|
static |
Parameter description for delete_purpose().
external_function_parameters |
|
static |
|
static |
Deny a data request.
int | $requestid | The request ID. |
array |
|
static |
Parameter description for deny_data_request().
external_function_parameters |
|
static |
|
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 |
|
static |
Fetches a list of activity options for setting data registry defaults.
boolean | $nodefaults | If false, it will fetch all of the activities. Otherwise, it will only fetch the activities that don't have defaults yet (e.g. when adding a new activity module defaults). |
array |
|
static |
Parameters for get_activity_options().
external_function_parameters |
|
static |
Returns for get_category_options().
external_single_structure |
|
static |
Fetches a list of data category options containing category IDs as keys and the category name for the value.
bool | $includeinherit | Whether to include the "Inherit" option. |
bool | $includenotset | Whether to include the "Not set" option. |
array |
|
static |
Parameters for get_category_options().
external_function_parameters |
|
static |
Returns for get_category_options().
external_single_structure |
|
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 tool_lp\external, and core_competency\external.
|
static |
Fetch the details of a user's data request.
int | $requestid | The request ID. |
array |
|
static |
Parameter description for get_data_request().
external_function_parameters |
|
static |
|
static |
Fetches a list of data storage purposes containing purpose IDs as keys and the purpose name for the value.
bool | $includeinherit | Whether to include the "Inherit" option. |
bool | $includenotset | Whether to include the "Not set" option. |
array |
|
static |
Parameters for get_purpose_options().
external_function_parameters |
|
static |
Returns for get_purpose_options().
external_single_structure |
|
static |
Fetch the details of a user's data request.
string | $query | The search request. |
array |
|
static |
Parameter description for get_data_request().
external_function_parameters |
|
static |
Parameter description for get_users().
external_description |
coding_exception |
|
static |
Mark a user's general enquiry's status as complete.
int | $requestid | The request ID of the general enquiry. |
array |
coding_exception | |
invalid_parameter_exception | |
invalid_persistent_exception | |
restricted_context_exception | |
dml_exception | |
moodle_exception |
|
static |
Parameter description for mark_complete().
external_function_parameters |
|
static |
|
static |
Updates the default category and purpose for a given context level (and optionally, a plugin).
int | $contextlevel | The context level. |
int | $category | The ID matching the category. |
int | $purpose | The ID matching the purpose record. |
int | $activity | The name of the activity that we're making a defaults configuration for. |
bool | $override | Whether to override the purpose/categories of existing instances to these defaults. |
array |
|
static |
Parameters for set_context_defaults().
external_function_parameters |
|
static |
Returns for set_context_defaults().
external_single_structure |
|
static |
Creates a data category from form data.
string | $jsonformdata |
array |
|
static |
Parameter description for set_context_form().
external_function_parameters |
|
static |
|
staticinherited |
Set context restriction for all following subsequent function calls.
stdClass | $context | the context restriction |
|
static |
Creates a data category from form data.
string | $jsonformdata |
array |
|
static |
Parameter description for set_contextlevel_form().
external_function_parameters |
|
static |
|
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 |
|
static |
Returns tree extra branches.
int | $contextid | |
string | $element |
array |
|
static |
Parameter description for tree_extra_branches().
external_function_parameters |
|
static |
|
staticinherited |
Makes sure user may execute functions in this context.
stdClass | $context |
|
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 |