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 39 and 400]

Privacy class for requesting user data.

Copyright: 2018 Sara Arjona <sara@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 389 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider  - X-Ref

Privacy class for requesting user data.

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

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

get_contexts_for_userid(int $userid)   X-Ref
Get the list of contexts that contain 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(\core_privacy\local\request\userlist $userlist)   X-Ref
Get the list of users who have data within a 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_item_data(\context $context, int $itemid, array $subcontext)   X-Ref
Export all user data related to a context and itemid.

param: \context $context    Context to export on.
param: int      $itemid     Item ID to export on.
param: array    $subcontext Directory location to export to.

delete_instance_data(\context $context, int $itemid = null)   X-Ref
Deletes all user data related to a context and possibly an itemid.

param: \context $context The context to delete on.
param: int|null $itemid  An optional item ID to refine the deletion.

delete_data_for_instances(\context $context, array $itemids = [])   X-Ref
Deletes all user data related to a context and possibly itemids.

param: \context $context The context to delete on.
param: array $itemids  An optional list of item IDs to refine the deletion.

export_definitions(\context $context, array $subcontext, int $userid = 0)   X-Ref
Exports the data related to grading definitions within the specified context/subcontext.

param: \context         $context Context owner of the data.
param: array            $subcontext Subcontext owner of the data.
param: int              $userid The user whose information is to be exported.

export_grading_instances(\context $context, array $subcontext, int $definitionid, int $userid = 0)   X-Ref
Exports the data related to grading instances within the specified definition.

param: \context         $context Context owner of the data.
param: array            $subcontext Subcontext owner of the data.
param: int              $definitionid The definition ID whose grading instance information is to be exported.
param: int              $userid The user whose information is to be exported.

delete_data_for_all_users_in_context(\context $context)   X-Ref
No deletion of the advanced grading is done.

param: \context $context the context to delete in.

delete_data_for_user(approved_contextlist $contextlist)   X-Ref
Deletion of data in this provider is only related to grades and so can not be
deleted for the creator of the advanced grade criteria.

param: approved_contextlist $contextlist a list of contexts approved for deletion.

delete_data_for_users(\core_privacy\local\request\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.