Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Privacy class for requesting user data.

Copyright: 2018 Adrian Greeve <adrian@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 271 lines (11 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.

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

export_comments(\context $context, string $component, string $commentarea, int $itemid,array $subcontext, bool $onlyforthisuser = true)   X-Ref
Writes user data to the writer for the user to download.

param: \context $context The context to export data for.
param: string $component The component that is calling this function
param: string $commentarea The comment area related to the component
param: int    $itemid An identifier for a group of comments
param: array  $subcontext The sub-context in which to export this data
param: bool   $onlyforthisuser  Only return the comments this user made.

delete_comments_for_all_users(\context $context, string $component, string $commentarea = null,int $itemid = null)   X-Ref
Deletes all comments for a specified context, component, and commentarea.

param: \context $context Details about which context to delete comments for.
param: string $component Component to delete.
param: string $commentarea Comment area to delete.
param: int $itemid The item ID for use with deletion.

delete_comments_for_all_users_select(\context $context, string $component, string $commentarea,$itemidstest, $params = [])   X-Ref
Deletes all comments for a specified context, component, and commentarea.

param: \context $context Details about which context to delete comments for.
param: string $component Component to delete.
param: string $commentarea Comment area to delete.
param: string $itemidstest an SQL fragment that the itemid must match. Used
param: array $params any query params used by $itemidstest.

delete_comments_for_user(\core_privacy\local\request\approved_contextlist $contextlist,string $component, string $commentarea = null, int $itemid = null)   X-Ref
Deletes all records for a user from a list of approved contexts.

param: \core_privacy\local\request\approved_contextlist $contextlist Contains the user ID and a list of contexts to be
param: string $component Component to delete from.
param: string $commentarea Area to delete from.
param: int $itemid The item id to delete from.

delete_comments_for_users(\core_privacy\local\request\approved_userlist $userlist,string $component, string $commentarea = null, int $itemid = null)   X-Ref
Deletes all records for a context from a list of approved users.

param: \core_privacy\local\request\approved_userlist $userlist Contains the list of users and
param: string $component Component to delete from.
param: string $commentarea Area to delete from.
param: int $itemid The item id to delete from.

get_users_in_context_from_sql(userlist $userlist, string $alias, string $component, string $area, int $contextid = null, string $insql = '',array $params = [])   X-Ref
Add the list of users who have commented in the specified constraints.

param: userlist    $userlist The userlist to add the users to.
param: string      $alias An alias prefix to use for comment selects to avoid interference with your own sql.
param: string      $component The component to check.
param: string      $area The comment area to check.
param: int         $contextid The context id.
param: string      $insql The SQL to use in a sub-select for the itemid query.
param: array       $params The params required for the insql.