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 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

Local stuff for meta course enrolment plugin.

Copyright: 2010 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 665 lines (31 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: enrol_meta_handler  - X-Ref

Event handler for meta enrolment plugin.

We try to keep everything in sync via listening to events,
it may fail sometimes, so we always do a full sync in cron too.
sync_course_instances($courseid, $userid)   X-Ref
Synchronise meta enrolments of this user in this course

return: void
param: int $courseid
param: int $userid

sync_with_parent_course(stdClass $instance, $userid)   X-Ref
Synchronise user enrolments in given instance as fast as possible.

All roles are removed if the meta plugin disabled.

return: void
param: stdClass $instance
param: int $userid

user_not_supposed_to_be_here($instance, $ue, context_course $context, $plugin)   X-Ref
Deal with users that are not supposed to be enrolled via this instance

return: void
param: stdClass $instance
param: stdClass $ue
param: context_course $context
param: enrol_meta $plugin

enrol_meta_sync($courseid = NULL, $verbose = false)   X-Ref
Sync all meta course links.

return: int 0 means ok, 1 means error, 2 means plugin disabled
param: int $courseid one course, empty mean all
param: bool $verbose verbose CLI output

enrol_meta_create_new_group($courseid, $linkedcourseid)   X-Ref
Create a new group with the course's name.

return: int $groupid Group ID for this cohort.
param: int $courseid
param: int $linkedcourseid