Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
enrol_category

Files

file  access.php
 Capabilities for category access plugin.
 
file  enrol_category_sync.php
 Syncing enrolments task.
 
file  events.php
 Category enrolment plugin event handler definition.
 
file  install.php
 category enrolment plugin installation.
 
file  lib.php
 Category enrolment plugin.
 
file  locallib.php
 Local stuff for category enrolment plugin.
 
file  observer.php
 Local stuff for category enrolment plugin.
 
file  provider.php
 Privacy Subsystem implementation for enrol_category.
 
file  settings.php
 Category enrolment plugin settings and presets.
 
file  tasks.php
 Task definition for enrol_category.
 
file  version.php
 Category enrolment plugin version specification.
 

Namespaces

namespace  enrol_category\privacy
  
 
namespace  enrol_category\task
  
 

Classes

class  enrol_category\privacy\provider
 Privacy Subsystem for enrol_category implementing null_provider. More...
 
class  enrol_category\task\enrol_category_sync
 Syncing enrolments task. More...
 
class  enrol_category_observer
 Event handler for category enrolment plugin. More...
 
class  enrol_category_plugin
 category enrolment plugin implementation. More...
 

Functions

 enrol_category_sync_course ($course)
 Sync all category enrolments in one course. More...
 
 enrol_category_sync_full (progress_trace $trace)
 Synchronise courses in all categories. More...
 
 xmldb_enrol_category_install ()
 

Variables

 $capabilities
 
 $observers
 
 $plugin = 2020060900
 
 $tasks
 
$plugin component = 'enrol_category'
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ enrol_category_sync_course()

enrol_category_sync_course (   $course)

Sync all category enrolments in one course.

Parameters
stdClass$course
Return values
void

◆ enrol_category_sync_full()

enrol_category_sync_full ( progress_trace  $trace)

Synchronise courses in all categories.

It gets out-of-sync if:

  • you move course to different category
  • reorder categories
  • disable enrol_category and enable it again
Parameters
progress_trace$trace
Return values
intexit code - 0 is ok, 1 means error, 2 if plugin disabled

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'enrol/category:synchronised' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
)
),
'enrol/category:config' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
)
const CONTEXT_SYSTEM
System context level - only one instance in every system.
Definition: accesslib.php:122
const CONTEXT_COURSE
Course context level - one instances for each course.
Definition: accesslib.php:128
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition: accesslib.php:115

◆ $observers

$observers
Initial value:
= array (
array (
'eventname' => '\core\event\role_assigned',
'callback' => 'enrol_category_observer::role_assigned',
),
array (
'eventname' => '\core\event\role_unassigned',
'callback' => 'enrol_category_observer::role_unassigned',
),
)

◆ $tasks

$tasks
Initial value:
= array(
array(
'classname' => '\enrol_category\task\enrol_category_sync',
'blocking' => 0,
'minute' => '*',
'hour' => '*',
'day' => '*',
'month' => '*',
'dayofweek' => '*',
'disabled' => 0
)
)