Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_privacy\local\request\helper Class Reference

The core_privacy\local\request\helper class with useful shared functionality. More...

Static Public Member Functions

static add_shared_contexts_to_contextlist_for (int $userid, contextlist $contextlist)
 Add core-controlled contexts which are related to a component but that component may know about.
 
static add_shared_users_to_userlist (\core_privacy\local\request\userlist $userlist)
 Add core-controlled contexts which are related to a component but that component may know about.
 
static delete_data_for_all_users_in_context (string $component, context $context)
 Handle removal of 'standard' data for any plugin.
 
static delete_data_for_all_users_in_context_course_module (string $component, context $context)
 Handle removal of 'standard' data for course modules.
 
static delete_data_for_user (approved_contextlist $contextlist)
 Delete all 'standard' user data for the specified user, in the specified contexts.
 
static export_context_files (\context $context, stdClass $user)
 Export all files for this context.
 
static export_data_for_null_provider (approved_contextlist $contextlist)
 Handle export of standard data for a plugin which implements the null provider and does not normally store data of its own.
 
static get_context_data (\context $context, stdClass $user)
 Get all general data for this context.
 

Static Protected Member Functions

static add_shared_contexts_to_contextlist_for_course_module (int $userid, contextlist $contextlist)
 Add core-controlled contexts which are related to a component but that component may know about.
 
static delete_data_for_user_in_course_module (approved_contextlist $contextlist)
 Delete all 'standard' user data for the specified user in course modules.
 
static export_context_module_files (\context_module $context, stdClass $user)
 Get all general data for the activity module at this context.
 
static get_context_block_data (\context_block $context, stdClass $user)
 Get all general data for the block at this context.
 
static get_context_module_data (\context_module $context, stdClass $user)
 Get all general data for the activity module at this context.
 

Detailed Description

The core_privacy\local\request\helper class with useful shared functionality.

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

Member Function Documentation

◆ add_shared_contexts_to_contextlist_for()

static core_privacy\local\request\helper::add_shared_contexts_to_contextlist_for ( int $userid,
contextlist $contextlist )
static

Add core-controlled contexts which are related to a component but that component may know about.

For example, most activities are not aware of activity completion, but the course implements it for them. These should be included.

Parameters
int$useridThe user being added for.
contextlist$contextlistThe contextlist being appended to.
Return values
contextlistThe final contextlist

◆ add_shared_contexts_to_contextlist_for_course_module()

static core_privacy\local\request\helper::add_shared_contexts_to_contextlist_for_course_module ( int $userid,
contextlist $contextlist )
staticprotected

Add core-controlled contexts which are related to a component but that component may know about.

For example, most activities are not aware of activity completion, but the course implements it for them. These should be included.

Parameters
int$useridThe user being added for.
contextlist$contextlistThe contextlist being appended to.
Return values
contextlistThe final contextlist

◆ add_shared_users_to_userlist()

static core_privacy\local\request\helper::add_shared_users_to_userlist ( \core_privacy\local\request\userlist $userlist)
static

Add core-controlled contexts which are related to a component but that component may know about.

For example, most activities are not aware of activity completion, but the course implements it for them. These should be included.

Parameters
core_privacy\local\request\userlist$userlist
Return values
contextlistThe final contextlist

◆ delete_data_for_all_users_in_context()

static core_privacy\local\request\helper::delete_data_for_all_users_in_context ( string $component,
context $context )
static

Handle removal of 'standard' data for any plugin.

This will handle deletion for things such as activity completion.

Parameters
string$componentThe component being deleted for.
context$contextThe specific context to delete data for.

◆ delete_data_for_all_users_in_context_course_module()

static core_privacy\local\request\helper::delete_data_for_all_users_in_context_course_module ( string $component,
context $context )
static

Handle removal of 'standard' data for course modules.

This will handle deletion for things such as activity completion.

Parameters
string$componentThe component being deleted for.
context$contextThe context to delete all data for.

◆ delete_data_for_user()

static core_privacy\local\request\helper::delete_data_for_user ( approved_contextlist $contextlist)
static

Delete all 'standard' user data for the specified user, in the specified contexts.

This will handle deletion for things such as activity completion.

Parameters
approved_contextlist$contextlistThe approved contexts and user information to delete information for.

◆ delete_data_for_user_in_course_module()

static core_privacy\local\request\helper::delete_data_for_user_in_course_module ( approved_contextlist $contextlist)
staticprotected

Delete all 'standard' user data for the specified user in course modules.

This will handle deletion for things such as activity completion.

Parameters
approved_contextlist$contextlistThe approved contexts and user information to delete information for.

◆ export_context_files()

static core_privacy\local\request\helper::export_context_files ( \context $context,
stdClass $user )
static

Export all files for this context.

Parameters
context$contextThe context to export files for.
stdClass$userThe user being written.
Return values
stdClass

◆ export_context_module_files()

static core_privacy\local\request\helper::export_context_module_files ( \context_module $context,
stdClass $user )
staticprotected

Get all general data for the activity module at this context.

Parameters
context_module$contextThe context to retrieve data for.
stdClass$userThe user being written.
Return values
stdClass

◆ export_data_for_null_provider()

static core_privacy\local\request\helper::export_data_for_null_provider ( approved_contextlist $contextlist)
static

Handle export of standard data for a plugin which implements the null provider and does not normally store data of its own.

This is used in cases such as activities like mod_resource, which do not store their own data, but may still have data on them (like Activity Completion).

Any context provided in a contextlist should have base data exported as a minimum.

Parameters
approved_contextlist$contextlistThe approved contexts to export information for.

◆ get_context_block_data()

static core_privacy\local\request\helper::get_context_block_data ( \context_block $context,
stdClass $user )
staticprotected

Get all general data for the block at this context.

Parameters
context_block$contextThe context to retrieve data for.
stdClass$userThe user being written.
Return values
stdClassGeneral data about this block instance.

◆ get_context_data()

static core_privacy\local\request\helper::get_context_data ( \context $context,
stdClass $user )
static

Get all general data for this context.

Parameters
context$contextThe context to retrieve data for.
stdClass$userThe user being written.
Return values
stdClass

◆ get_context_module_data()

static core_privacy\local\request\helper::get_context_module_data ( \context_module $context,
stdClass $user )
staticprotected

Get all general data for the activity module at this context.

Parameters
context_module$contextThe context to retrieve data for.
stdClass$userThe user being written.
Return values
stdClass

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