Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 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: 2 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

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

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.

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

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

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

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

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

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

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