Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
enrol_meta

Namespaces

namespace  enrol_meta\external
  
 
namespace  enrol_meta\privacy
  
 
namespace  enrol_meta\task
  
 

Classes

class  enrol_meta\external\add_instances
 
class  enrol_meta\external\delete_instances
 
class  enrol_meta\privacy\provider
 Privacy provider for enrol_meta. More...
 
class  enrol_meta\task\enrol_meta_sync
 Meta sync enrolments task. More...
 
class  enrol_meta_handler
 Event handler for meta enrolment plugin. More...
 
class  enrol_meta_observer
 Event observer for enrol_meta. More...
 
class  enrol_meta_plugin
 Meta course enrolment plugin. More...
 

Functions

 enrol_meta_create_new_group ($courseid, $linkedcourseid)
 Create a new group with the course's name.
 
 enrol_meta_sync ($courseid=NULL, $verbose=false)
 Sync all meta course links.
 
 xmldb_enrol_meta_install ()
 
 xmldb_enrol_meta_uninstall ()
 

Variables

 $capabilities
 
 $functions
 
 $observers
 
 $plugin = 2024041600
 
 $tasks
 
$plugin component = 'enrol_meta'
 
const ENROL_META_CREATE_GROUP -1
 ENROL_META_CREATE_GROUP constant for automatically creating a group for a meta course.
 
$plugin version = 2024042200
 

Detailed Description

Function Documentation

◆ enrol_meta_create_new_group()

enrol_meta_create_new_group ( $courseid,
$linkedcourseid )

Create a new group with the course's name.

Parameters
int$courseid
int$linkedcourseid
Return values
int\$groupidGroup ID for this cohort.

◆ enrol_meta_sync()

enrol_meta_sync ( $courseid = NULL,
$verbose = false )

Sync all meta course links.

Parameters
int$courseidone course, empty mean all
bool$verboseverbose CLI output
Return values
int0 means ok, 1 means error, 2 means plugin disabled

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'enrol/meta:config' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
'enrol/meta:selectaslinked' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
)
),
'enrol/meta:unenrol' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
)
),
)
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

◆ $functions

$functions
Initial value:
= [
'enrol_meta_add_instances' => [
'classname' => enrol_meta\external\add_instances::class,
'methodname' => 'execute',
'description' => 'Add meta enrolment instances',
'capabilities' => 'enrol/meta:config',
'type' => 'write',
'ajax' => true,
'loginrequired' => true,
],
'enrol_meta_delete_instances' => [
'classname' => enrol_meta\external\delete_instances::class,
'methodname' => 'execute',
'description' => 'Delete meta enrolment instances',
'capabilities' => 'enrol/meta:config',
'type' => 'write',
'ajax' => true,
'loginrequired' => true,
],
]

◆ $tasks

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