Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | List of all members
core_tag\privacy\provider Class Reference

Privacy Subsystem implementation for core_tag. More...

Inheritance diagram for core_tag\privacy\provider:
core_privacy\local\metadata\provider core_privacy\local\request\subsystem\plugin_provider core_privacy\local\request\core_userlist_provider core_privacy\local\request\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\core_user_data_provider core_privacy\local\request\userlist_provider core_privacy\local\request\data_provider core_privacy\local\request\core_data_provider core_privacy\local\request\data_provider

Static Public Member Functions

static delete_data_for_all_users_in_context (\context $context)
 Delete all data for all users in the specified context. More...
 
static delete_data_for_user (approved_contextlist $contextlist)
 Delete all user data for the specified user, in the specified contexts. More...
 
static delete_data_for_users (approved_userlist $userlist)
 Delete multiple users within a single context. More...
 
static delete_item_tags (\context $context, $component, $itemtype, $itemid=null, $userid=null)
 Deletes all tag instances for given context, component, itemtype, itemid. More...
 
static delete_item_tags_select (\context $context, $component, $itemtype, $itemidstest, $params=[])
 Deletes all tag instances for given context, component, itemtype using subquery for itemids. More...
 
static export_item_tags (int $userid, context $context, array $subcontext, string $component, string $itemtype, int $itemid, bool $onlyuser=false)
 Store all tags which match the specified component, itemtype, and itemid. More...
 
static export_user_data (approved_contextlist $contextlist)
 Export all user data for the specified user, in the specified contexts. More...
 
static get_contexts_for_userid (int $userid)
 Get the list of contexts that contain user information for the specified user. More...
 
static get_metadata (collection $collection)
 Returns meta data about this system. More...
 
static get_users_in_context (userlist $userlist)
 Get the list of users within a specific context. More...
 

Detailed Description

Privacy Subsystem implementation for core_tag.

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

Member Function Documentation

◆ delete_data_for_all_users_in_context()

static core_tag\privacy\provider::delete_data_for_all_users_in_context ( \context  $context)
static

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.

Parameters
context$contextThe specific context to delete data for.

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_user()

static core_tag\privacy\provider::delete_data_for_user ( approved_contextlist  $contextlist)
static

Delete all user data for the specified user, in the specified contexts.

Parameters
approved_contextlist$contextlistThe approved contexts and user information to delete information for.

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_users()

static core_tag\privacy\provider::delete_data_for_users ( approved_userlist  $userlist)
static

Delete multiple users within a single context.

Parameters
approved_userlist$userlistThe approved context and user information to delete information for.

Implements core_privacy\local\request\core_userlist_provider.

◆ delete_item_tags()

static core_tag\privacy\provider::delete_item_tags ( \context  $context,
  $component,
  $itemtype,
  $itemid = null,
  $userid = null 
)
static

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.

Parameters
context$contextThe context to export for
string$componentTagarea component
string$itemtypeTagarea item type
int$itemidThe itemid within that component and itemtype (optional)
int$useridOnly delete tag instances made by this user, per-user tags must be enabled for the tagarea

◆ delete_item_tags_select()

static core_tag\privacy\provider::delete_item_tags_select ( \context  $context,
  $component,
  $itemtype,
  $itemidstest,
  $params = [] 
)
static

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.

Parameters
context$contextThe context to export for
string$componentTagarea component
string$itemtypeTagarea item type
string$itemidstestan SQL fragment that the itemid must match. Used in the query like WHERE itemid $itemidstest. Must use named parameters, and may not use named parameters called contextid, component or itemtype.
array$paramsany query params used by $itemidstest.

◆ export_item_tags()

static core_tag\privacy\provider::export_item_tags ( int  $userid,
context  $context,
array  $subcontext,
string  $component,
string  $itemtype,
int  $itemid,
bool  $onlyuser = false 
)
static

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.

Parameters
int$useridThe user whose information is to be exported
context$contextThe context to export for
array$subcontextThe subcontext within the context to export this information
string$componentThe component to fetch data from
string$itemtypeThe itemtype that the data was exported in within the component
int$itemidThe itemid within that tag
bool$onlyuserWhether to only export ratings that the current user has made, or all tags

◆ export_user_data()

static core_tag\privacy\provider::export_user_data ( approved_contextlist  $contextlist)
static

Export all user data for the specified user, in the specified contexts.

Parameters
approved_contextlist$contextlistThe approved contexts to export information for.

Implements core_privacy\local\request\core_user_data_provider.

◆ get_contexts_for_userid()

static core_tag\privacy\provider::get_contexts_for_userid ( int  $userid)
static

Get the list of contexts that contain user information for the specified user.

Parameters
int$useridThe user to search.
Return values
contextlist::$contextlistThe contextlist containing the list of contexts used in this plugin.

Implements core_privacy\local\request\core_user_data_provider.

◆ get_metadata()

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

Returns meta data about this system.

Parameters
collection$collectionThe initialised collection to add items to.
Return values
collectionA listing of user data stored through this system.

Implements core_privacy\local\metadata\provider.

◆ get_users_in_context()

static core_tag\privacy\provider::get_users_in_context ( userlist  $userlist)
static

Get the list of users within a specific context.

Parameters
userlist$userlistThe userlist containing the list of users who have data in this context/plugin combination.

Implements core_privacy\local\request\core_userlist_provider.


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