Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

Privacy class for requesting user data.

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

Defines 1 class


Class: provider  - X-Ref

Privacy Subsystem for core_calendar implementing metadata, plugin, and user_preference providers.

get_metadata(collection $collection)   X-Ref
Provides meta data that is stored about a user with core_calendar.

return: collection Returns the collection of metadata.
param: collection $collection A collection of meta data items to be added to.

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

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

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.

export_user_preferences(int $userid)   X-Ref
Export all user preferences for the plugin.

param: int $userid The userid of the user whose data is to be exported.

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

param: context $context Transform 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.

export_user_calendar_event_data(approved_contextlist $contextlist)   X-Ref
Helper function to export Calendar Events data by a User's contextlist.

param: approved_contextlist $contextlist

export_user_calendar_subscription_data(approved_contextlist $contextlist)   X-Ref
Helper function to export Calendar Subscriptions data by a User's contextlist.

param: approved_contextlist $contextlist

get_calendar_event_ids_by_context(\context $context, $userids = array()   X-Ref
Helper function to return all Calendar Event id results for a specified context and optionally
included user list.

return: array|null
param: \context $context
param: array $userids

get_calendar_subscription_ids_by_context(\context $context, $userids = array()   X-Ref
Helper function to return all Calendar Subscription id results for a specified context and optionally
included user list.

return: array
param: \context $context
param: array $userids

get_calendar_event_details_by_contextlist(approved_contextlist $contextlist)   X-Ref
Helper function to return the Calendar Events for a given user and context list.

return: array
param: approved_contextlist $contextlist

get_calendar_subscription_details_by_contextlist(approved_contextlist $contextlist)   X-Ref
Helper function to return the Calendar Subscriptions for a given user and context list.

return: array
param: approved_contextlist $contextlist

delete_batch_records($tablename, $field, $values)   X-Ref
Helper function to delete records in batches in order to minimise amount of deletion queries.

param: string    $tablename  The table name to delete from.
param: string    $field      The table column field name to delete records by.
param: array     $values     The table column field values to delete records by.