Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
external

Classes

class  core_enrol_external
 Enrol external functions. More...
 
class  core_role_external
 Role external functions. More...
 

Functions

static get_course_enrolment_methods ($courseid)
 Get list of active course enrolment methods for current user.
 
static get_course_enrolment_methods_parameters ()
 Returns description of get_course_enrolment_methods() parameters.
 
static get_course_enrolment_methods_returns ()
 Returns description of get_course_enrolment_methods() result value.
 
static get_enrolled_users ($courseid, $options=[])
 Get course participants details.
 
static get_enrolled_users_parameters ()
 Returns description of method parameters.
 
static get_enrolled_users_returns ()
 Returns description of method result value.
 
static get_potential_users_returns ()
 Returns description of method result value.
 
static search_users (int $courseid, string $search, bool $searchanywhere, int $page, int $perpage, ?int $contextid=null)
 Search course participants.
 
static search_users_parameters ()
 Returns description of method parameters.
 
static search_users_returns ()
 Returns description of method result value.
 
static submit_user_enrolment_form ($formdata)
 External function that handles the user enrolment form submission.
 
static submit_user_enrolment_form_parameters ()
 Returns description of submit_user_enrolment_form parameters.
 
static submit_user_enrolment_form_returns ()
 Returns description of submit_user_enrolment_form() result value.
 
static unenrol_user_enrolment ($ueid)
 External function that unenrols a given user enrolment.
 
static unenrol_user_enrolment_parameters ()
 Returns description of unenrol_user_enrolment() parameters.
 
static unenrol_user_enrolment_returns ()
 Returns description of unenrol_user_enrolment() result value.
 

Detailed Description

Function Documentation

◆ get_course_enrolment_methods()

static get_course_enrolment_methods ( $courseid)
static

Get list of active course enrolment methods for current user.

Parameters
int$courseid
Return values
arrayof course enrolment methods
Exceptions
moodle_exception

◆ get_course_enrolment_methods_parameters()

static get_course_enrolment_methods_parameters ( )
static

Returns description of get_course_enrolment_methods() parameters.

Return values
external_function_parameters

◆ get_course_enrolment_methods_returns()

static get_course_enrolment_methods_returns ( )
static

Returns description of get_course_enrolment_methods() result value.

Return values
core_external\external_description

◆ get_enrolled_users()

static get_enrolled_users ( $courseid,
$options = [] )
static

Get course participants details.

Parameters
int$courseidcourse id
array$optionsoptions { 'name' => option name 'value' => option value }
Return values
arrayAn array of users

◆ get_enrolled_users_parameters()

static get_enrolled_users_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_enrolled_users_returns()

static get_enrolled_users_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_potential_users_returns()

static get_potential_users_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ search_users()

static search_users ( int $courseid,
string $search,
bool $searchanywhere,
int $page,
int $perpage,
?int $contextid = null )
static

Search course participants.

Parameters
int$courseidCourse id
string$searchThe query
bool$searchanywhereMatch anywhere in the string
int$pagePage number
int$perpageMax per page
?int$contextidContext ID we are in - we might use search on activity level and its group mode can be different from course group mode.
Return values
arrayAn array of users
Exceptions
moodle_exception

◆ search_users_parameters()

static search_users_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ search_users_returns()

static search_users_returns ( )
static

Returns description of method result value.

Return values
external_multiple_structure

◆ submit_user_enrolment_form()

static submit_user_enrolment_form ( $formdata)
static

External function that handles the user enrolment form submission.

Parameters
string$formdataThe user enrolment form data in s URI encoded param string
Return values
arrayAn array consisting of the processing result and error flag, if available

◆ submit_user_enrolment_form_parameters()

static submit_user_enrolment_form_parameters ( )
static

Returns description of submit_user_enrolment_form parameters.

Return values
external_function_parameters

◆ submit_user_enrolment_form_returns()

static submit_user_enrolment_form_returns ( )
static

Returns description of submit_user_enrolment_form() result value.

Return values
core_external\external_description

◆ unenrol_user_enrolment()

static unenrol_user_enrolment ( $ueid)
static

External function that unenrols a given user enrolment.

Parameters
int$ueidThe user enrolment ID.
Return values
arrayAn array consisting of the processing result, errors.

◆ unenrol_user_enrolment_parameters()

static unenrol_user_enrolment_parameters ( )
static

Returns description of unenrol_user_enrolment() parameters.

Return values
external_function_parameters

◆ unenrol_user_enrolment_returns()

static unenrol_user_enrolment_returns ( )
static

Returns description of unenrol_user_enrolment() result value.

Return values
core_external\external_description