Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Privacy Subsystem implementation for core_tag.

Copyright: 2018 Zig Tan <zig@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 328 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider  - X-Ref

Privacy Subsystem implementation for core_tag.

get_metadata(collection $collection)   X-Ref
Returns meta data about this system.

param: collection     $collection The initialised collection to add items to.
return: collection     A listing of user data stored through this system.

export_item_tags(int $userid,\context $context,array $subcontext,string $component,string $itemtype,int $itemid,bool $onlyuser = false)   X-Ref
Store all tags which match the specified component, itemtype, and itemid.

In most situations you will want to specify $onlyuser as false.
This will fetch only tags where the user themselves set the tag, or where tags are a shared resource.

If you specify $onlyuser as true, only the tags created by that user will be included.

param: int         $userid The user whose information is to be exported
param: \context    $context The context to export for
param: array       $subcontext The subcontext within the context to export this information
param: string      $component The component to fetch data from
param: string      $itemtype The itemtype that the data was exported in within the component
param: int         $itemid The itemid within that tag
param: bool        $onlyuser Whether to only export ratings that the current user has made, or all tags

delete_item_tags(\context $context, $component, $itemtype,$itemid = null, $userid = null)   X-Ref
Deletes all tag instances for given context, component, itemtype, itemid

In most situations you will want to specify $userid as null. Per-user tag instances
are possible in Tags API, however there are no components or standard plugins that actually use them.

param: \context    $context The context to export for
param: string      $component Tagarea component
param: string      $itemtype Tagarea item type
param: int         $itemid The itemid within that component and itemtype (optional)
param: int         $userid Only delete tag instances made by this user, per-user tags must be enabled for the tagarea

delete_item_tags_select(\context $context, $component, $itemtype,$itemidstest, $params = [])   X-Ref
Deletes all tag instances for given context, component, itemtype using subquery for itemids

In most situations you will want to specify $userid as null. Per-user tag instances
are possible in Tags API, however there are no components or standard plugins that actually use them.

param: \context    $context The context to export for
param: string      $component Tagarea component
param: string      $itemtype Tagarea item type
param: string      $itemidstest an SQL fragment that the itemid must match. Used
param: array $params any query params used by $itemidstest.

get_contexts_for_userid(int $userid)   X-Ref
Get the list of contexts that contain user information for the specified user.

param: int         $userid     The user to search.
return: contextlist   $contextlist  The contextlist containing the list of contexts used in this plugin.

get_users_in_context(userlist $userlist)   X-Ref
Get the list of users within a specific context.

param: userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.

export_user_data(approved_contextlist $contextlist)   X-Ref
Export all user data for the specified user, in the specified contexts.

param: approved_contextlist    $contextlist    The approved contexts to export information for.

delete_data_for_all_users_in_context(\context $context)   X-Ref
Delete all data for all users in the specified context.

We do not delete tag instances in this method - this should be done by the components that define tagareas.
We only delete tags themselves in case of system context.

param: context $context   The specific context to delete data for.

delete_data_for_users(approved_userlist $userlist)   X-Ref
Delete multiple users within a single context.

param: approved_userlist $userlist The approved context and user information to delete information for.

delete_data_for_user(approved_contextlist $contextlist)   X-Ref
Delete all user data for the specified user, in the specified contexts.

param: approved_contextlist    $contextlist    The approved contexts and user information to delete information for.