Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Privacy Subsystem implementation for core_message. More...
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). More... | |
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). More... | |
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. More... | |
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. More... | |
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. More... | |
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 | 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. More... | |
static | export_user_data (approved_contextlist $contextlist) |
Export personal data for the given approved_contextlist. More... | |
static | export_user_preferences (int $userid) |
Store all user preferences for core message. 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 $items) |
Return the fields which contain personal data. More... | |
static | get_users_in_context (userlist $userlist) |
Get the list of users who have data within a context. More... | |
Static Protected Member Functions | |
static | delete_user_data (int $userid) |
Delete all user data for the specified user. More... | |
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. More... | |
static | export_user_data_blocked_users (int $userid) |
Export the messaging blocked users data. More... | |
static | export_user_data_contact_requests (int $userid) |
Export the messaging contact requests data. More... | |
static | export_user_data_contacts (int $userid) |
Export the messaging contact data. More... | |
static | export_user_data_conversation_messages (int $userid, stdClass $conversation, context $context, array $subcontext=[]) |
Export conversation messages. More... | |
static | export_user_data_notifications (int $userid) |
Export the notification data. More... | |
Privacy Subsystem implementation for core_message.
|
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.
contextlist | $contextlist | |
int | $userid | The id of the user in scope. |
string | $component | the frankenstyle component name. |
string | $itemtype | the type of the conversation items. |
int | $itemid | Optional itemid associated with component. |
|
static |
Add the list of users who have a conversation in the specified area (component + itemtype + itemid).
userlist | $userlist | The userlist to add the users to. |
string | $component | The component to check. |
string | $itemtype | The type of the conversation items. |
int | $itemid | Optional itemid associated with component. |
|
static |
Deletes all group memberships for a specified context and component.
context | $context | Details about which context to delete group memberships for. |
string | $component | The component to delete. Empty string means no component. |
string | $itemtype | The itemtype of the component to delele. Empty string means no itemtype. |
int | $itemid | Optional itemid associated with component. |
|
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.
approved_contextlist | $contextlist | Contains the user ID and a list of contexts to be deleted from. |
string | $component | The component to delete. Empty string means no component. |
string | $itemtype | The itemtype of the component to delele. Empty string means no itemtype. |
int | $itemid | Optional itemid associated with component. |
|
static |
Deletes all records for multiple users within a single context.
approved_userlist | $userlist | The approved context and user information to delete information for. |
string | $component | The component to delete. Empty string means no component. |
string | $itemtype | The itemtype of the component to delele. Empty string means no itemtype. |
int | $itemid | Optional itemid associated with component. |
|
static |
Delete all data for all users in the specified context.
context | $context | the context to delete in. |
Implements core_privacy\local\request\core_user_data_provider.
|
static |
Delete all user data for the specified user, in the specified contexts.
approved_contextlist | $contextlist | a list of contexts approved for deletion. |
Implements core_privacy\local\request\core_user_data_provider.
|
static |
Delete multiple users within a single context.
approved_userlist | $userlist | The approved context and user information to delete information for. |
Implements core_privacy\local\request\core_userlist_provider.
|
staticprotected |
Delete all user data for the specified user.
int | $userid | The user id |
|
staticprotected |
Deletes all records for multiple users within multiple contexts in a component area.
int | $userid | The user identifier to delete information for. |
array | $contextids | The context identifiers to delete information for. Empty array means no context (for individual conversations). |
string | $component | The component to delete. Empty string means no component (for individual conversations). |
string | $itemtype | The itemtype of the component to delele. Empty string means no itemtype (for individual conversations). |
int | $itemid | Optional itemid associated with component. |
|
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>'.
int | $userid | The user whose information is to be exported. |
string | $component | The component to fetch data from. |
string | $itemtype | The itemtype that the data was exported in within the component. |
context | $context | The context to export for. |
array | $subcontext | The sub-context in which to export this data. |
int | $itemid | Optional itemid associated with component. |
|
static |
Export personal data for the given approved_contextlist.
User and context information is contained within the contextlist.
approved_contextlist | $contextlist | a list of contexts approved for export. |
Implements core_privacy\local\request\core_user_data_provider.
|
staticprotected |
Export the messaging blocked users data.
int | $userid |
|
staticprotected |
Export the messaging contact requests data.
int | $userid |
|
staticprotected |
Export the messaging contact data.
int | $userid |
|
staticprotected |
Export conversation messages.
int | $userid | The user identifier. |
stdClass | $conversation | The conversation to export the messages. |
context | $context | The context to export for. |
array | $subcontext | The sub-context in which to export this data. |
|
staticprotected |
Export the notification data.
int | $userid |
|
static |
Store all user preferences for core message.
int | $userid | The userid of the user whose data is to be exported. |
Implements core_privacy\local\request\user_preference_provider.
|
static |
Get the list of contexts that contain user information for the specified user.
int | $userid | the userid. |
contextlist | the list of contexts containing user info for the user. |
Implements core_privacy\local\request\core_user_data_provider.
|
static |
Return the fields which contain personal data.
collection | $items | a reference to the collection to use to store the metadata. |
collection | the updated collection of metadata items. |
Implements core_privacy\local\metadata\provider.
|
static |
Get the list of users who have data within a context.
userlist | $userlist | The userlist containing the list of users who have data in this context/plugin combination. |
Implements core_privacy\local\request\core_userlist_provider.