Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [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

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.