Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_customfield\privacy\provider Class Reference

Class provider. More...

Inheritance diagram for core_customfield\privacy\provider:
core_privacy\local\metadata\provider core_privacy\local\request\subsystem\plugin_provider core_privacy\local\request\shared_userlist_provider core_privacy\local\request\shared_data_provider core_privacy\local\request\userlist_provider core_privacy\local\request\data_provider

Static Public Member Functions

static delete_customfields_configuration (approved_contextlist $contextlist, string $component, string $area, string $itemidstest='IS NOT NULL', array $params=[])
 Deletes customfields configuration (categories and fields) and all relevant data.
 
static delete_customfields_configuration_for_context (string $component, string $area, context $context)
 Deletes all customfields configuration (categories and fields) and all relevant data for the given category context.
 
static delete_customfields_data (approved_contextlist $contextlist, string $component, string $area, string $itemidstest='IS NOT NULL', string $instanceidstest='IS NOT NULL', array $params=[])
 Deletes customfields data.
 
static delete_customfields_data_for_context (string $component, string $area, context $context)
 Deletes all customfields data for the given context.
 
static export_customfield_data (data_controller $data, array $subcontext)
 Exports one instance of custom field data.
 
static export_customfields_data (approved_contextlist $contextlist, string $component, string $area, string $itemidstest='IS NOT NULL', string $instanceidstest='IS NOT NULL', array $params=[], array $subcontext=null)
 Exports customfields data.
 
static get_customfields_configuration_contexts (string $component, string $area, string $itemidstest='IS NOT NULL', array $params=[])
 Returns contexts that have customfields configuration (categories and fields)
 
static get_customfields_data_contexts (string $component, string $area, string $itemidstest='IS NOT NULL', string $instanceidstest='IS NOT NULL', array $params=[])
 Returns contexts that have customfields data.
 
static get_metadata (collection $collection)
 Return the fields which contain personal data.
 

Static Protected Member Functions

static before_delete_data (string $dataidstest, array $params)
 Executes callbacks from the customfield plugins to delete anything related to the data records (usually files)
 
static before_delete_fields (string $categoryidstest, array $params)
 Executes callbacks from the plugins to delete anything related to the fields (usually files)
 
static delete_categories (array $contextids, array $categoriesids)
 Delete custom fields categories configurations, all their fields and data.
 
static export_customfield_data_unknown (\stdClass $record, stdClass $field, array $subcontext)
 Export data record of unknown type when we were not able to create instance of data_controller.
 
static get_params (string $component, string $area, array $params)
 Checks that $params is an associative array and adds parameters for component and area.
 

Detailed Description

Class provider.

Customfields API does not directly store userid and does not perform any export or delete functionality by itself

However this class defines several functions that can be utilized by components that use customfields API to export/delete user data.

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

Member Function Documentation

◆ before_delete_data()

static core_customfield\privacy\provider::before_delete_data ( string $dataidstest,
array $params )
staticprotected

Executes callbacks from the customfield plugins to delete anything related to the data records (usually files)

Parameters
string$dataidstest
array$params

◆ before_delete_fields()

static core_customfield\privacy\provider::before_delete_fields ( string $categoryidstest,
array $params )
staticprotected

Executes callbacks from the plugins to delete anything related to the fields (usually files)

Also deletes description files

Parameters
string$categoryidstest
array$params

◆ delete_categories()

static core_customfield\privacy\provider::delete_categories ( array $contextids,
array $categoriesids )
staticprotected

Delete custom fields categories configurations, all their fields and data.

Parameters
array$contextids
array$categoriesids

◆ delete_customfields_configuration()

static core_customfield\privacy\provider::delete_customfields_configuration ( approved_contextlist $contextlist,
string $component,
string $area,
string $itemidstest = 'IS NOT NULL',
array $params = [] )
static

Deletes customfields configuration (categories and fields) and all relevant data.

To be used in implementations of core_user_data_provider\delete_data_for_user in cases when user is an owner of the fields configuration and it is considered user information (quite unlikely situtation but we never know what customfields API can be used for)

Caller needs to transfer the $userid to the select subquery for customfield_category->itemid

Parameters
approved_contextlist$contextlist
string$component
string$area
string$itemidstestsubquery for selecting customfield_category->itemid
array$paramsarray of named parameters for itemidstest subquery

◆ delete_customfields_configuration_for_context()

static core_customfield\privacy\provider::delete_customfields_configuration_for_context ( string $component,
string $area,
context $context )
static

Deletes all customfields configuration (categories and fields) and all relevant data for the given category context.

To be used in implementations of core_user_data_provider\delete_data_for_all_users_in_context

Parameters
string$component
string$area
context$context

◆ delete_customfields_data()

static core_customfield\privacy\provider::delete_customfields_data ( approved_contextlist $contextlist,
string $component,
string $area,
string $itemidstest = 'IS NOT NULL',
string $instanceidstest = 'IS NOT NULL',
array $params = [] )
static

Deletes customfields data.

To be used in implementations of core_user_data_provider\delete_data_for_user Caller needs to transfer the $userid to the select subqueries for customfield_category->itemid and/or customfield_data->instanceid

Parameters
approved_contextlist$contextlist
string$component
string$area
string$itemidstestsubquery for selecting customfield_category->itemid
string$instanceidstestsubquery for selecting customfield_data->instanceid
array$paramsarray of named parameters for itemidstest and instanceidstest subqueries

◆ delete_customfields_data_for_context()

static core_customfield\privacy\provider::delete_customfields_data_for_context ( string $component,
string $area,
context $context )
static

Deletes all customfields data for the given context.

To be used in implementations of core_user_data_provider\delete_data_for_all_users_in_context

Parameters
string$component
string$area
context$context

◆ export_customfield_data()

static core_customfield\privacy\provider::export_customfield_data ( data_controller $data,
array $subcontext )
static

Exports one instance of custom field data.

Parameters
data_controller$data
array$subcontextsubcontext to pass to content_writer\export_data

◆ export_customfield_data_unknown()

static core_customfield\privacy\provider::export_customfield_data_unknown ( \stdClass $record,
stdClass $field,
array $subcontext )
staticprotected

Export data record of unknown type when we were not able to create instance of data_controller.

Parameters
stdClass$recordrecord from db table {customfield_data}
stdClass$fieldfield record with at least fields type, shortname, name
array$subcontext

◆ export_customfields_data()

static core_customfield\privacy\provider::export_customfields_data ( approved_contextlist $contextlist,
string $component,
string $area,
string $itemidstest = 'IS NOT NULL',
string $instanceidstest = 'IS NOT NULL',
array $params = [],
array $subcontext = null )
static

Exports customfields data.

To be used in implementations of core_user_data_provider\export_user_data Caller needs to transfer the $userid to the select subqueries for customfield_category->itemid and/or customfield_data->instanceid

Parameters
approved_contextlist$contextlist
string$component
string$area
string$itemidstestsubquery for selecting customfield_category->itemid
string$instanceidstestsubquery for selecting customfield_data->instanceid
array$paramsarray of named parameters for itemidstest and instanceidstest subqueries
array$subcontextsubcontext to use in context_writer\export_data, if null (default) the "Custom fields data" will be used; the data id will be appended to the subcontext array.

◆ get_customfields_configuration_contexts()

static core_customfield\privacy\provider::get_customfields_configuration_contexts ( string $component,
string $area,
string $itemidstest = 'IS NOT NULL',
array $params = [] )
static

Returns contexts that have customfields configuration (categories and fields)

To be used in implementations of core_user_data_provider\get_contexts_for_userid in cases when user is an owner of the fields configuration Caller needs to transfer the $userid to the select subquery for customfield_category->itemid

Parameters
string$component
string$area
string$itemidstestsubquery for selecting customfield_category->itemid
array$paramsarray of named parameters for itemidstest subquery
Return values
contextlist

◆ get_customfields_data_contexts()

static core_customfield\privacy\provider::get_customfields_data_contexts ( string $component,
string $area,
string $itemidstest = 'IS NOT NULL',
string $instanceidstest = 'IS NOT NULL',
array $params = [] )
static

Returns contexts that have customfields data.

To be used in implementations of core_user_data_provider\get_contexts_for_userid Caller needs to transfer the $userid to the select subqueries for customfield_category->itemid and/or customfield_data->instanceid

Parameters
string$component
string$area
string$itemidstestsubquery for selecting customfield_category->itemid
string$instanceidstestsubquery for selecting customfield_data->instanceid
array$paramsarray of named parameters
Return values
contextlist

◆ get_metadata()

static core_customfield\privacy\provider::get_metadata ( collection $collection)
static

Return the fields which contain personal data.

Parameters
collection$collectiona reference to the collection to use to store the metadata.
Return values
collectionthe updated collection of metadata items.

Implements core_privacy\local\metadata\provider.

◆ get_params()

static core_customfield\privacy\provider::get_params ( string $component,
string $area,
array $params )
staticprotected

Checks that $params is an associative array and adds parameters for component and area.

Parameters
string$component
string$area
array$params
Return values
array
Exceptions
coding_exception

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