Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Static Protected Member Functions | List of all members
tool_dataprivacy\external Class Reference

Class external. More...

Inheritance diagram for tool_dataprivacy\external:
external_api

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...
 

Detailed Description

Class external.

The external API for the Data Privacy tool.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ approve_data_request()

static tool_dataprivacy\external::approve_data_request (   $requestid)
static

Approve a data request.

Since
Moodle 3.5
Parameters
int$requestidThe request ID.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception
moodle_exception

◆ approve_data_request_parameters()

static tool_dataprivacy\external::approve_data_request_parameters ( )
static

Parameter description for approve_data_request().

Since
Moodle 3.5
Return values
external_function_parameters

◆ approve_data_request_returns()

static tool_dataprivacy\external::approve_data_request_returns ( )
static

Parameter description for approve_data_request().

Since
Moodle 3.5
Return values
external_description

◆ bulk_approve_data_requests()

static tool_dataprivacy\external::bulk_approve_data_requests (   $requestids)
static

Bulk approve bulk data request.

Since
Moodle 3.5
Parameters
array$requestidsArray consisting the request ID's.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception
moodle_exception

◆ bulk_approve_data_requests_parameters()

static tool_dataprivacy\external::bulk_approve_data_requests_parameters ( )
static

Parameter description for bulk_approve_data_requests().

Since
Moodle 3.5
Return values
external_function_parameters

◆ bulk_approve_data_requests_returns()

static tool_dataprivacy\external::bulk_approve_data_requests_returns ( )
static

Parameter description for bulk_approve_data_requests().

Since
Moodle 3.5
Return values
external_description

◆ bulk_deny_data_requests()

static tool_dataprivacy\external::bulk_deny_data_requests (   $requestids)
static

Bulk deny data requests.

Since
Moodle 3.5
Parameters
array$requestidsArray consisting of request ID's.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception
moodle_exception

◆ bulk_deny_data_requests_parameters()

static tool_dataprivacy\external::bulk_deny_data_requests_parameters ( )
static

Parameter description for bulk_deny_data_requests().

Since
Moodle 3.5
Return values
external_function_parameters

◆ bulk_deny_data_requests_returns()

static tool_dataprivacy\external::bulk_deny_data_requests_returns ( )
static

Parameter description for bulk_deny_data_requests().

Since
Moodle 3.5
Return values
external_description

◆ call_external_function()

static external_api::call_external_function (   $function,
  $args,
  $ajaxonly = false 
)
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.

Parameters
string$functionA webservice function name.
array$argsParams array (named params)
boolean$ajaxonlyIf true, an extra check will be peformed to see if ajax is required.
Return values
arraycontaining keys for error (bool), exception and data.

◆ cancel_data_request()

static tool_dataprivacy\external::cancel_data_request (   $requestid)
static

Cancel a data request.

Since
Moodle 3.5
Parameters
int$requestidThe request ID.
Return values
array
Exceptions
invalid_persistent_exception
coding_exception
invalid_parameter_exception
restricted_context_exception

◆ cancel_data_request_parameters()

static tool_dataprivacy\external::cancel_data_request_parameters ( )
static

Parameter description for cancel_data_request().

Since
Moodle 3.5
Return values
external_function_parameters

◆ cancel_data_request_returns()

static tool_dataprivacy\external::cancel_data_request_returns ( )
static

Parameter description for cancel_data_request().

Since
Moodle 3.5
Return values
external_description

◆ clean_returnvalue()

static external_api::clean_returnvalue ( external_description  $description,
  $response 
)
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.

Parameters
external_description$descriptiondescription of the return values
mixed$responsethe actual response
Return values
mixedresponse with added defaults for optional items, invalid_response_exception thrown if any problem found
Author
2010 Jerome Mouneyrac
Since
Moodle 2.0

◆ confirm_contexts_for_deletion()

static tool_dataprivacy\external::confirm_contexts_for_deletion (   $ids)
static

Confirm a given array of expired context record IDs.

Since
Moodle 3.5
Parameters
int[]$idsArray of record IDs from the expired contexts table.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception

◆ confirm_contexts_for_deletion_parameters()

static tool_dataprivacy\external::confirm_contexts_for_deletion_parameters ( )
static

Parameters for confirm_contexts_for_deletion().

Since
Moodle 3.5
Return values
external_function_parameters

◆ confirm_contexts_for_deletion_returns()

static tool_dataprivacy\external::confirm_contexts_for_deletion_returns ( )
static

Returns for confirm_contexts_for_deletion().

Since
Moodle 3.5
Return values
external_single_structure

◆ contact_dpo()

static tool_dataprivacy\external::contact_dpo (   $message)
static

Make a general enquiry to a DPO.

Since
Moodle 3.5
Parameters
string$messageThe message to be sent to the DPO.
Return values
array
Exceptions
coding_exception
invalid_parameter_exception
invalid_persistent_exception
restricted_context_exception
dml_exception
moodle_exception

◆ contact_dpo_parameters()

static tool_dataprivacy\external::contact_dpo_parameters ( )
static

Parameter description for contact_dpo().

Since
Moodle 3.5
Return values
external_function_parameters

◆ contact_dpo_returns()

static tool_dataprivacy\external::contact_dpo_returns ( )
static

Parameter description for contact_dpo().

Since
Moodle 3.5
Return values
external_description

◆ create_category_form()

static tool_dataprivacy\external::create_category_form (   $jsonformdata)
static

Creates a data category from form data.

Since
Moodle 3.5
Parameters
string$jsonformdata
Return values
array

◆ create_category_form_parameters()

static tool_dataprivacy\external::create_category_form_parameters ( )
static

Parameter description for create_category_form().

Since
Moodle 3.5
Return values
external_function_parameters

◆ create_category_form_returns()

static tool_dataprivacy\external::create_category_form_returns ( )
static

Returns for create_category_form().

Since
Moodle 3.5
Return values
external_single_structure

◆ create_purpose_form()

static tool_dataprivacy\external::create_purpose_form (   $jsonformdata)
static

Creates a data purpose from form data.

Since
Moodle 3.5
Parameters
string$jsonformdata
Return values
array

◆ create_purpose_form_parameters()

static tool_dataprivacy\external::create_purpose_form_parameters ( )
static

Parameter description for create_purpose_form().

Since
Moodle 3.5
Return values
external_function_parameters

◆ create_purpose_form_returns()

static tool_dataprivacy\external::create_purpose_form_returns ( )
static

Returns for create_purpose_form().

Since
Moodle 3.5
Return values
external_single_structure

◆ delete_category()

static tool_dataprivacy\external::delete_category (   $id)
static

Deletes a data category.

Since
Moodle 3.5
Parameters
int$idThe ID.
Return values
array
Exceptions
invalid_persistent_exception
coding_exception
invalid_parameter_exception

◆ delete_category_parameters()

static tool_dataprivacy\external::delete_category_parameters ( )
static

Parameter description for delete_category().

Since
Moodle 3.5
Return values
external_function_parameters

◆ delete_category_returns()

static tool_dataprivacy\external::delete_category_returns ( )
static

Parameter description for delete_category().

Since
Moodle 3.5
Return values
external_single_structure

◆ delete_purpose()

static tool_dataprivacy\external::delete_purpose (   $id)
static

Deletes a data purpose.

Since
Moodle 3.5
Parameters
int$idThe ID.
Return values
array
Exceptions
invalid_persistent_exception
coding_exception
invalid_parameter_exception

◆ delete_purpose_parameters()

static tool_dataprivacy\external::delete_purpose_parameters ( )
static

Parameter description for delete_purpose().

Since
Moodle 3.5
Return values
external_function_parameters

◆ delete_purpose_returns()

static tool_dataprivacy\external::delete_purpose_returns ( )
static

Parameter description for delete_purpose().

Since
Moodle 3.5
Return values
external_single_structure

◆ deny_data_request()

static tool_dataprivacy\external::deny_data_request (   $requestid)
static

Deny a data request.

Since
Moodle 3.5
Parameters
int$requestidThe request ID.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception
moodle_exception

◆ deny_data_request_parameters()

static tool_dataprivacy\external::deny_data_request_parameters ( )
static

Parameter description for deny_data_request().

Since
Moodle 3.5
Return values
external_function_parameters

◆ deny_data_request_returns()

static tool_dataprivacy\external::deny_data_request_returns ( )
static

Parameter description for deny_data_request().

Since
Moodle 3.5
Return values
external_description

◆ external_function_info()

static external_api::external_function_info (   $function,
  $strictness = MUST_EXIST 
)
staticinherited

Returns detailed function information.

Parameters
string | object$functionname of external function or record from external_function
int$strictnessIGNORE_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
Return values
stdClassdescription or false if not found or exception thrown
Since
Moodle 2.0

◆ get_activity_options()

static tool_dataprivacy\external::get_activity_options (   $nodefaults)
static

Fetches a list of activity options for setting data registry defaults.

Parameters
boolean$nodefaultsIf 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).
Return values
array

◆ get_activity_options_parameters()

static tool_dataprivacy\external::get_activity_options_parameters ( )
static

◆ get_activity_options_returns()

static tool_dataprivacy\external::get_activity_options_returns ( )
static

◆ get_category_options()

static tool_dataprivacy\external::get_category_options (   $includeinherit,
  $includenotset 
)
static

Fetches a list of data category options containing category IDs as keys and the category name for the value.

Parameters
bool$includeinheritWhether to include the "Inherit" option.
bool$includenotsetWhether to include the "Not set" option.
Return values
array

◆ get_category_options_parameters()

static tool_dataprivacy\external::get_category_options_parameters ( )
static

◆ get_category_options_returns()

static tool_dataprivacy\external::get_category_options_returns ( )
static

◆ get_context_from_params()

static external_api::get_context_from_params (   $param)
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.

Parameters
array$param
Since
Moodle 2.6
Exceptions
invalid_parameter_exception
Return values
context

◆ get_context_parameters()

static external_api::get_context_parameters ( )
staticprotectedinherited

Returns a prepared structure to use a context parameters.

Return values
external_single_structure

Reimplemented in tool_lp\external, and core_competency\external.

◆ get_data_request()

static tool_dataprivacy\external::get_data_request (   $requestid)
static

Fetch the details of a user's data request.

Since
Moodle 3.5
Parameters
int$requestidThe request ID.
Return values
array
Exceptions
coding_exception
dml_exception
invalid_parameter_exception
restricted_context_exception
moodle_exception

◆ get_data_request_parameters()

static tool_dataprivacy\external::get_data_request_parameters ( )
static

Parameter description for get_data_request().

Since
Moodle 3.5
Return values
external_function_parameters

◆ get_data_request_returns()

static tool_dataprivacy\external::get_data_request_returns ( )
static

Parameter description for get_data_request().

Since
Moodle 3.5
Return values
external_description

◆ get_purpose_options()

static tool_dataprivacy\external::get_purpose_options (   $includeinherit,
  $includenotset 
)
static

Fetches a list of data storage purposes containing purpose IDs as keys and the purpose name for the value.

Parameters
bool$includeinheritWhether to include the "Inherit" option.
bool$includenotsetWhether to include the "Not set" option.
Return values
array

◆ get_purpose_options_parameters()

static tool_dataprivacy\external::get_purpose_options_parameters ( )
static

Parameters for get_purpose_options().

Return values
external_function_parameters

◆ get_purpose_options_returns()

static tool_dataprivacy\external::get_purpose_options_returns ( )
static

◆ get_users()

static tool_dataprivacy\external::get_users (   $query)
static

Fetch the details of a user's data request.

Since
Moodle 3.5
Parameters
string$queryThe search request.
Return values
array
Exceptions
required_capability_exception
dml_exception
invalid_parameter_exception
restricted_context_exception

◆ get_users_parameters()

static tool_dataprivacy\external::get_users_parameters ( )
static

Parameter description for get_data_request().

Since
Moodle 3.5
Return values
external_function_parameters

◆ get_users_returns()

static tool_dataprivacy\external::get_users_returns ( )
static

Parameter description for get_users().

Since
Moodle 3.5
Return values
external_description
Exceptions
coding_exception

◆ mark_complete()

static tool_dataprivacy\external::mark_complete (   $requestid)
static

Mark a user's general enquiry's status as complete.

Since
Moodle 3.5.2
Parameters
int$requestidThe request ID of the general enquiry.
Return values
array
Exceptions
coding_exception
invalid_parameter_exception
invalid_persistent_exception
restricted_context_exception
dml_exception
moodle_exception

◆ mark_complete_parameters()

static tool_dataprivacy\external::mark_complete_parameters ( )
static

Parameter description for mark_complete().

Since
Moodle 3.5.2
Return values
external_function_parameters

◆ mark_complete_returns()

static tool_dataprivacy\external::mark_complete_returns ( )
static

Parameter description for mark_complete().

Since
Moodle 3.5.2
Return values
external_description

◆ set_context_defaults()

static tool_dataprivacy\external::set_context_defaults (   $contextlevel,
  $category,
  $purpose,
  $activity,
  $override 
)
static

Updates the default category and purpose for a given context level (and optionally, a plugin).

Parameters
int$contextlevelThe context level.
int$categoryThe ID matching the category.
int$purposeThe ID matching the purpose record.
int$activityThe name of the activity that we're making a defaults configuration for.
bool$overrideWhether to override the purpose/categories of existing instances to these defaults.
Return values
array

◆ set_context_defaults_parameters()

static tool_dataprivacy\external::set_context_defaults_parameters ( )
static

◆ set_context_defaults_returns()

static tool_dataprivacy\external::set_context_defaults_returns ( )
static

◆ set_context_form()

static tool_dataprivacy\external::set_context_form (   $jsonformdata)
static

Creates a data category from form data.

Since
Moodle 3.5
Parameters
string$jsonformdata
Return values
array

◆ set_context_form_parameters()

static tool_dataprivacy\external::set_context_form_parameters ( )
static

Parameter description for set_context_form().

Since
Moodle 3.5
Return values
external_function_parameters

◆ set_context_form_returns()

static tool_dataprivacy\external::set_context_form_returns ( )
static

Returns for set_context_form().

Since
Moodle 3.5
Return values
external_single_structure

◆ set_context_restriction()

static external_api::set_context_restriction (   $context)
staticinherited

Set context restriction for all following subsequent function calls.

Parameters
stdClass$contextthe context restriction
Since
Moodle 2.0

◆ set_contextlevel_form()

static tool_dataprivacy\external::set_contextlevel_form (   $jsonformdata)
static

Creates a data category from form data.

Since
Moodle 3.5
Parameters
string$jsonformdata
Return values
array

◆ set_contextlevel_form_parameters()

static tool_dataprivacy\external::set_contextlevel_form_parameters ( )
static

Parameter description for set_contextlevel_form().

Since
Moodle 3.5
Return values
external_function_parameters

◆ set_contextlevel_form_returns()

static tool_dataprivacy\external::set_contextlevel_form_returns ( )
static

Returns for set_contextlevel_form().

Since
Moodle 3.5
Return values
external_single_structure

◆ set_timeout()

static external_api::set_timeout (   $seconds = 360)
staticinherited

This method has to be called before every operation that takes a longer time to finish!

Parameters
int$secondsmax expected time the next operation needs
Since
Moodle 2.0

◆ tree_extra_branches()

static tool_dataprivacy\external::tree_extra_branches (   $contextid,
  $element 
)
static

Returns tree extra branches.

Since
Moodle 3.5
Parameters
int$contextid
string$element
Return values
array

◆ tree_extra_branches_parameters()

static tool_dataprivacy\external::tree_extra_branches_parameters ( )
static

Parameter description for tree_extra_branches().

Since
Moodle 3.5
Return values
external_function_parameters

◆ tree_extra_branches_returns()

static tool_dataprivacy\external::tree_extra_branches_returns ( )
static

Returns for tree_extra_branches().

Since
Moodle 3.5
Return values
external_single_structure

◆ validate_context()

static external_api::validate_context (   $context)
staticinherited

Makes sure user may execute functions in this context.

Parameters
stdClass$context
Since
Moodle 2.0

◆ validate_parameters()

static external_api::validate_parameters ( external_description  $description,
  $params 
)
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.

Parameters
external_description$descriptiondescription of parameters
mixed$paramsthe actual parameters
Return values
mixedparams with added defaults for optional items, invalid_parameters_exception thrown if any problem found
Since
Moodle 2.0

The documentation for this class was generated from the following file: