Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_message\privacy\provider Class Reference

Privacy Subsystem implementation for core_message. More...

Inheritance diagram for core_message\privacy\provider:
core_privacy\local\metadata\provider core_privacy\local\request\subsystem\provider core_privacy\local\request\user_preference_provider core_privacy\local\request\core_userlist_provider core_privacy\local\request\subsystem\plugin_provider core_privacy\local\request\core_user_data_provider core_privacy\local\request\core_data_provider core_privacy\local\request\userlist_provider core_privacy\local\request\shared_data_provider core_privacy\local\request\core_data_provider core_privacy\local\request\data_provider core_privacy\local\request\data_provider core_privacy\local\request\data_provider

Static Public Member Functions

static add_contexts_for_conversations (contextlist $contextlist, int $userid, string $component, string $itemtype, int $itemid=0)
 Provide a list of contexts which have conversations for the user, in the respective area (component/itemtype combination).
 
static add_conversations_in_context (userlist $userlist, string $component, string $itemtype, int $itemid=0)
 Add the list of users who have a conversation in the specified area (component + itemtype + itemid).
 
static delete_conversations_for_all_users (\context $context, string $component, string $itemtype, int $itemid=0)
 Deletes all group memberships for a specified context and component.
 
static delete_conversations_for_user (approved_contextlist $contextlist, string $component, string $itemtype, int $itemid=0)
 Deletes all records for a user from a list of approved contexts.
 
static delete_conversations_for_users (approved_userlist $userlist, string $component, string $itemtype, int $itemid=0)
 Deletes all records for multiple users within a single context.
 
static delete_data_for_all_users_in_context (\context $context)
 Delete all data for all users in the specified context.
 
static delete_data_for_user (approved_contextlist $contextlist)
 Delete all user data for the specified user, in the specified contexts.
 
static delete_data_for_users (approved_userlist $userlist)
 Delete multiple users within a single context.
 
static export_conversations (int $userid, string $component, string $itemtype, context $context, array $subcontext=[], int $itemid=0)
 Store all conversations which match the specified component, itemtype, and itemid.
 
static export_user_data (approved_contextlist $contextlist)
 Export personal data for the given approved_contextlist.
 
static export_user_preferences (int $userid)
 Store all user preferences for core message.
 
static get_contexts_for_userid (int $userid)
 Get the list of contexts that contain user information for the specified user.
 
static get_metadata (collection $items)
 Return the fields which contain personal data.
 
static get_users_in_context (userlist $userlist)
 Get the list of users who have data within a context.
 

Static Protected Member Functions

static delete_user_data (int $userid)
 Delete all user data for the specified user.
 
static delete_user_data_conversations (int $userid, array $contextids, string $component, string $itemtype, int $itemid=0)
 Deletes all records for multiple users within multiple contexts in a component area.
 
static export_user_data_blocked_users (int $userid)
 Export the messaging blocked users data.
 
static export_user_data_contact_requests (int $userid)
 Export the messaging contact requests data.
 
static export_user_data_contacts (int $userid)
 Export the messaging contact data.
 
static export_user_data_conversation_messages (int $userid, stdClass $conversation, context $context, array $subcontext=[])
 Export conversation messages.
 
static export_user_data_notifications (int $userid)
 Export the notification data.
 

Detailed Description

Privacy Subsystem implementation for core_message.

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

Member Function Documentation

◆ add_contexts_for_conversations()

static core_message\privacy\provider::add_contexts_for_conversations ( contextlist $contextlist,
int $userid,
string $component,
string $itemtype,
int $itemid = 0 )
static

Provide a list of contexts which have conversations for the user, in the respective area (component/itemtype combination).

This method is to be called by consumers of the messaging subsystem (plugins), in their get_contexts_for_userid() method, to add the contexts for items which may have any conversation, but would normally not be reported as having user data by the plugin responsible for them.

Parameters
contextlist$contextlist
int$useridThe id of the user in scope.
string$componentthe frankenstyle component name.
string$itemtypethe type of the conversation items.
int$itemidOptional itemid associated with component.

◆ add_conversations_in_context()

static core_message\privacy\provider::add_conversations_in_context ( userlist $userlist,
string $component,
string $itemtype,
int $itemid = 0 )
static

Add the list of users who have a conversation in the specified area (component + itemtype + itemid).

Parameters
userlist$userlistThe userlist to add the users to.
string$componentThe component to check.
string$itemtypeThe type of the conversation items.
int$itemidOptional itemid associated with component.

◆ delete_conversations_for_all_users()

static core_message\privacy\provider::delete_conversations_for_all_users ( \context $context,
string $component,
string $itemtype,
int $itemid = 0 )
static

Deletes all group memberships for a specified context and component.

Parameters
context$contextDetails about which context to delete group memberships for.
string$componentThe component to delete. Empty string means no component.
string$itemtypeThe itemtype of the component to delele. Empty string means no itemtype.
int$itemidOptional itemid associated with component.

◆ delete_conversations_for_user()

static core_message\privacy\provider::delete_conversations_for_user ( approved_contextlist $contextlist,
string $component,
string $itemtype,
int $itemid = 0 )
static

Deletes all records for a user from a list of approved contexts.

When the component and the itemtype are empty and there is only one user context in the list, all the conversations without contextid will be removed. However, if the component and itemtype are defined, only the conversations in these area for the contexts in $contextlist wil be deleted.

Parameters
approved_contextlist$contextlistContains the user ID and a list of contexts to be deleted from.
string$componentThe component to delete. Empty string means no component.
string$itemtypeThe itemtype of the component to delele. Empty string means no itemtype.
int$itemidOptional itemid associated with component.

◆ delete_conversations_for_users()

static core_message\privacy\provider::delete_conversations_for_users ( approved_userlist $userlist,
string $component,
string $itemtype,
int $itemid = 0 )
static

Deletes all records for multiple users within a single context.

Parameters
approved_userlist$userlistThe approved context and user information to delete information for.
string$componentThe component to delete. Empty string means no component.
string$itemtypeThe itemtype of the component to delele. Empty string means no itemtype.
int$itemidOptional itemid associated with component.

◆ delete_data_for_all_users_in_context()

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

Delete all data for all users in the specified context.

Parameters
context$contextthe context to delete in.

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_user()

static core_message\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$contextlista list of contexts approved for deletion.

Implements core_privacy\local\request\core_user_data_provider.

◆ delete_data_for_users()

static core_message\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_user_data()

static core_message\privacy\provider::delete_user_data ( int $userid)
staticprotected

Delete all user data for the specified user.

Parameters
int$useridThe user id

◆ delete_user_data_conversations()

static core_message\privacy\provider::delete_user_data_conversations ( int $userid,
array $contextids,
string $component,
string $itemtype,
int $itemid = 0 )
staticprotected

Deletes all records for multiple users within multiple contexts in a component area.

Parameters
int$useridThe user identifier to delete information for.
array$contextidsThe context identifiers to delete information for. Empty array means no context (for individual conversations).
string$componentThe component to delete. Empty string means no component (for individual conversations).
string$itemtypeThe itemtype of the component to delele. Empty string means no itemtype (for individual conversations).
int$itemidOptional itemid associated with component.

◆ export_conversations()

static core_message\privacy\provider::export_conversations ( int $userid,
string $component,
string $itemtype,
context $context,
array $subcontext = [],
int $itemid = 0 )
static

Store all conversations which match the specified component, itemtype, and itemid.

Conversations without context (for now, the private ones) are stored in '<$context> | Messages | <Other user id>'. Conversations with context are stored in '<$context> | Messages | <Conversation item type> | <Conversation name>'.

Parameters
int$useridThe user whose information is to be exported.
string$componentThe component to fetch data from.
string$itemtypeThe itemtype that the data was exported in within the component.
context$contextThe context to export for.
array$subcontextThe sub-context in which to export this data.
int$itemidOptional itemid associated with component.

◆ export_user_data()

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

Export personal data for the given approved_contextlist.

User and context information is contained within the contextlist.

Parameters
approved_contextlist$contextlista list of contexts approved for export.

Implements core_privacy\local\request\core_user_data_provider.

◆ export_user_data_blocked_users()

static core_message\privacy\provider::export_user_data_blocked_users ( int $userid)
staticprotected

Export the messaging blocked users data.

Parameters
int$userid

◆ export_user_data_contact_requests()

static core_message\privacy\provider::export_user_data_contact_requests ( int $userid)
staticprotected

Export the messaging contact requests data.

Parameters
int$userid

◆ export_user_data_contacts()

static core_message\privacy\provider::export_user_data_contacts ( int $userid)
staticprotected

Export the messaging contact data.

Parameters
int$userid

◆ export_user_data_conversation_messages()

static core_message\privacy\provider::export_user_data_conversation_messages ( int $userid,
stdClass $conversation,
context $context,
array $subcontext = [] )
staticprotected

Export conversation messages.

Parameters
int$useridThe user identifier.
stdClass$conversationThe conversation to export the messages.
context$contextThe context to export for.
array$subcontextThe sub-context in which to export this data.

◆ export_user_data_notifications()

static core_message\privacy\provider::export_user_data_notifications ( int $userid)
staticprotected

Export the notification data.

Parameters
int$userid

◆ export_user_preferences()

static core_message\privacy\provider::export_user_preferences ( int $userid)
static

Store all user preferences for core message.

Parameters
int$useridThe userid of the user whose data is to be exported.

Implements core_privacy\local\request\user_preference_provider.

◆ get_contexts_for_userid()

static core_message\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 userid.
Return values
contextlistthe list of contexts containing user info for the user.

Implements core_privacy\local\request\core_user_data_provider.

◆ get_metadata()

static core_message\privacy\provider::get_metadata ( collection $items)
static

Return the fields which contain personal data.

Parameters
collection$itemsa 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_users_in_context()

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

Get the list of users who have data within a 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: