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.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

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: 342 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.

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

get_course_completion_join_sql(int $userid, string $prefix, string $joinfield)   X-Ref
Get join sql to retrieve courses the user is in.

param: int $userid The user ID
param: string $prefix A unique prefix for these joins.
param: string $joinfield A field to join these tables to. Joins to course ID.
return: array The join, where, and params for this join.

add_course_completion_users_to_userlist(userlist $userlist)   X-Ref
Find users' course completion by context and add to the provided userlist.

param: userlist $userlist The userlist to add to.

get_activity_completion_info(\stdClass $user, \stdClass $course, $cm)   X-Ref
Returns activity completion information about a user.

param: \stdClass $user The user to return information about.
param: \stdClass $course The course the user is in.
param: \stdClass $cm Course module information.
return: \stdClass Activity completion information.

get_course_completion_info(\stdClass $user, \stdClass $course)   X-Ref
Returns course completion information for a user.

param: \stdClass $user The user that we are getting completion information for.
param: \stdClass $course The course we are interested in.
return: \stdClass Course completion information.

delete_completion(\stdClass $user = null, int $courseid = null, int $cmid = null)   X-Ref
Delete completion information for users.

param: \stdClass $user The user. If provided will delete completion information for just this user. Else all users.
param: int $courseid The course id. Provide this if you want course completion and activity completion deleted.
param: int $cmid The course module id. Provide this if you only want activity completion deleted.

delete_completion_by_approved_userlist(approved_userlist $userlist, int $courseid = null, int $cmid = null)   X-Ref
Delete completion information for users within an approved userlist.

param: approved_userlist $userlist The approved userlist of users to delete completion information for.
param: int $courseid The course id. Provide this if you want course completion and activity completion deleted.
param: int $cmid The course module id. Provide this if you only want activity completion deleted.