Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | List of all members
core_comment\privacy\provider Class Reference

Privacy class for requesting user data. More...

Inheritance diagram for core_comment\privacy\provider:
core_privacy\local\metadata\provider core_privacy\local\request\subsystem\plugin_provider core_privacy\local\request\shared_userlist_provider core_privacy\local\request\shared_data_provider core_privacy\local\request\userlist_provider core_privacy\local\request\data_provider

Static Public Member Functions

static delete_comments_for_all_users (\context $context, string $component, string $commentarea=null, int $itemid=null)
 Deletes all comments for a specified context, component, and commentarea. More...
 
static delete_comments_for_all_users_select (\context $context, string $component, string $commentarea, $itemidstest, $params=[])
 Deletes all comments for a specified context, component, and commentarea. More...
 
static delete_comments_for_user (\core_privacy\local\request\approved_contextlist $contextlist, string $component, string $commentarea=null, int $itemid=null)
 Deletes all records for a user from a list of approved contexts. More...
 
static delete_comments_for_users (\core_privacy\local\request\approved_userlist $userlist, string $component, string $commentarea=null, int $itemid=null)
 Deletes all records for a context from a list of approved users. More...
 
static export_comments (\context $context, string $component, string $commentarea, int $itemid, array $subcontext, bool $onlyforthisuser=true)
 Writes user data to the writer for the user to download. More...
 
static get_metadata (collection $collection)
 Returns meta data about this system. More...
 
static get_users_in_context_from_sql (userlist $userlist, string $alias, string $component, string $area, int $contextid=null, string $insql='', array $params=[])
 Add the list of users who have commented in the specified constraints. More...
 

Detailed Description

Privacy class for requesting user data.

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

Member Function Documentation

◆ delete_comments_for_all_users()

static core_comment\privacy\provider::delete_comments_for_all_users ( \context  $context,
string  $component,
string  $commentarea = null,
int  $itemid = null 
)
static

Deletes all comments for a specified context, component, and commentarea.

Parameters
context$contextDetails about which context to delete comments for.
string$componentComponent to delete.
string$commentareaComment area to delete.
int$itemidThe item ID for use with deletion.

◆ delete_comments_for_all_users_select()

static core_comment\privacy\provider::delete_comments_for_all_users_select ( \context  $context,
string  $component,
string  $commentarea,
  $itemidstest,
  $params = [] 
)
static

Deletes all comments for a specified context, component, and commentarea.

Parameters
context$contextDetails about which context to delete comments for.
string$componentComponent to delete.
string$commentareaComment area to delete.
string$itemidstestan SQL fragment that the itemid must match. Used in the query like WHERE itemid $itemidstest. Must use named parameters, and may not use named parameters called contextid, component or commentarea.
array$paramsany query params used by $itemidstest.

◆ delete_comments_for_user()

static core_comment\privacy\provider::delete_comments_for_user ( \core_privacy\local\request\approved_contextlist  $contextlist,
string  $component,
string  $commentarea = null,
int  $itemid = null 
)
static

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

Parameters
core_privacy\local\request\approved_contextlist$contextlistContains the user ID and a list of contexts to be deleted from.
string$componentComponent to delete from.
string$commentareaArea to delete from.
int$itemidThe item id to delete from.

◆ delete_comments_for_users()

static core_comment\privacy\provider::delete_comments_for_users ( \core_privacy\local\request\approved_userlist  $userlist,
string  $component,
string  $commentarea = null,
int  $itemid = null 
)
static

Deletes all records for a context from a list of approved users.

Parameters
core_privacy\local\request\approved_userlist$userlistContains the list of users and a context to be deleted from.
string$componentComponent to delete from.
string$commentareaArea to delete from.
int$itemidThe item id to delete from.

◆ export_comments()

static core_comment\privacy\provider::export_comments ( \context  $context,
string  $component,
string  $commentarea,
int  $itemid,
array  $subcontext,
bool  $onlyforthisuser = true 
)
static

Writes user data to the writer for the user to download.

Parameters
context$contextThe context to export data for.
string$componentThe component that is calling this function
string$commentareaThe comment area related to the component
int$itemidAn identifier for a group of comments
array$subcontextThe sub-context in which to export this data
bool$onlyforthisuserOnly return the comments this user made.

◆ get_metadata()

static core_comment\privacy\provider::get_metadata ( collection  $collection)
static

Returns meta data about this system.

Parameters
collection$collectionThe initialised collection to add items to.
Return values
collectionA listing of user data stored through this system.

Implements core_privacy\local\metadata\provider.

◆ get_users_in_context_from_sql()

static core_comment\privacy\provider::get_users_in_context_from_sql ( userlist  $userlist,
string  $alias,
string  $component,
string  $area,
int  $contextid = null,
string  $insql = '',
array  $params = [] 
)
static

Add the list of users who have commented in the specified constraints.

Parameters
userlist$userlistThe userlist to add the users to.
string$aliasAn alias prefix to use for comment selects to avoid interference with your own sql.
string$componentThe component to check.
string$areaThe comment area to check.
int$contextidThe context id.
string$insqlThe SQL to use in a sub-select for the itemid query.
array$paramsThe params required for the insql.

The documentation for this class was generated from the following file: