|
Moodle
2.2.1
http://www.collinsharper.com
|
This class provides a targeted tied together means of interfacing the enrolment tasks together with a course.
It is provided as a convenience more than anything else.
Definition at line 39 of file locallib.php.
| __construct | ( | moodle_page $ | moodlepage, |
| $ | course, | ||
| $ | instancefilter = null |
||
| ) |
#@- Constructs the course enrolment manager
| moodle_page | $moodlepage | |
| stdClass | $course | |
| string | $instancefilter |
Definition at line 113 of file locallib.php.

| add_user_to_group | ( | $ | user, |
| $ | groupid | ||
| ) |
Adds a user to a group
| stdClass | $user | |
| int | $groupid |
Definition at line 586 of file locallib.php.

| assign_role_to_user | ( | $ | roleid, |
| $ | userid | ||
| ) |
Assigns a role to a user.
| int | $roleid | |
| int | $userid |
Definition at line 568 of file locallib.php.

| edit_enrolment | ( | $ | userenrolment, |
| $ | data | ||
| ) |
Edits an enrolment
| stdClass | $userenrolment | |
| stdClass | $data |
Definition at line 634 of file locallib.php.

| get_all_groups | ( | ) |
Gets all of the groups for this course.
Definition at line 489 of file locallib.php.


| get_all_roles | ( | ) |
Gets all of the roles this course can contain.
Definition at line 451 of file locallib.php.


| get_assignable_roles | ( | $ | otherusers = false | ) |
Gets all of the assignable roles for this course.
Definition at line 463 of file locallib.php.


| get_context | ( | ) |
Returns the course context
Definition at line 744 of file locallib.php.

| get_course | ( | ) |
Returns the course this object is managing enrolments for
Definition at line 735 of file locallib.php.

Returns the current enrolment filter that is being applied by this class
Definition at line 652 of file locallib.php.

Returns the names for all of the enrolment instances for this course.
Definition at line 418 of file locallib.php.


Returns all of the enrolment instances for this course.
Definition at line 406 of file locallib.php.


Gets all of the enrolment plugins that are active for this course.
Definition at line 439 of file locallib.php.


Returns the enrolment plugin that the course manager was being filtered to.
If no filter was being applied then this function returns false.
Definition at line 932 of file locallib.php.

| get_group | ( | $ | groupid | ) |
Gets the requested group
| int | $groupid |
Definition at line 619 of file locallib.php.


| get_instance_sql | ( | ) | [protected] |
Gets an array containing some SQL to user for when selecting, params for that SQL, and the filter that was used in constructing the sql.
moodle_database $DB
Definition at line 377 of file locallib.php.


Definition at line 901 of file locallib.php.
| get_moodlepage | ( | ) |
Returns the current moodle page
Definition at line 124 of file locallib.php.

| get_other_users | ( | $ | sort, |
| $ | direction = 'ASC', |
||
| $ | page = 0, |
||
| $ | perpage = 25 |
||
| ) |
Gets and array of other users.
Other users are users who have been assigned roles or inherited roles within this course but who have not been enrolled in the course
moodle_database $DB
| string | $sort | |
| string | $direction | |
| int | $page | |
| int | $perpage |
Definition at line 237 of file locallib.php.


| get_other_users_for_display | ( | core_enrol_renderer $ | renderer, |
| moodle_url $ | pageurl, | ||
| $ | sort, | ||
| $ | direction, | ||
| $ | page, | ||
| $ | perpage | ||
| ) |
Gets an array of other users in this course ready for display.
Other users are users who have been assigned or inherited roles within this course but have not been enrolled.
| core_enrol_renderer | $renderer | |
| moodle_url | $pageurl | |
| string | $sort | |
| string | $direction | ASC | DESC |
| int | $page | Starting from 0 |
| int | $perpage |
Definition at line 762 of file locallib.php.

| get_potential_users | ( | $ | enrolid, |
| $ | search = '', |
||
| $ | searchanywhere = false, |
||
| $ | page = 0, |
||
| $ | perpage = 25 |
||
| ) |
Gets an array of the users that can be enrolled in this course.
moodle_database $DB
| int | $enrolid | |
| string | $search | |
| bool | $searchanywhere | |
| int | $page | Defaults to 0 |
| int | $perpage | Defaults to 25 |
Definition at line 277 of file locallib.php.

Returns the total number of enrolled users in the course.
If a filter was specificed this will be the total number of users enrolled in this course by means of that instance.
moodle_database $DB
Definition at line 159 of file locallib.php.

| get_total_users | ( | ) |
Returns the total number of enrolled users in the course.
If a filter was specificed this will be the total number of users enrolled in this course by means of that instance.
moodle_database $DB
Definition at line 137 of file locallib.php.

| get_url_params | ( | ) |
Retursn an array of params that would go into the URL to return to this exact page.
Definition at line 720 of file locallib.php.

| get_user_enrolment_components | ( | $ | userenrolment | ) |
Given a user enrolment record this method returns the plugin and enrolment instance that relate to it.
| stdClass | int | $userenrolment |
Definition at line 523 of file locallib.php.


| get_user_enrolments | ( | $ | userid | ) |
Gets the enrolments this user has in the course
moodle_database $DB
| int | $userid |
Definition at line 688 of file locallib.php.


| get_user_groups | ( | $ | userid | ) |
Gets the groups this user belongs to
| int | $userid |
Definition at line 710 of file locallib.php.


| get_user_roles | ( | $ | userid | ) |
Gets the roles assigned to this user that are applicable for this course.
| int | $userid |
Definition at line 662 of file locallib.php.

| get_users | ( | $ | sort, |
| $ | direction = 'ASC', |
||
| $ | page = 0, |
||
| $ | perpage = 25 |
||
| ) |
Gets all of the users enrolled in this course.
If a filter was specified this will be the users who were enrolled in this course by means of that instance.
moodle_database $DB
| string | $sort | |
| string | $direction | ASC or DESC |
| int | $page | First page should be 0 |
| int | $perpage | Defaults to 25 |
Definition at line 194 of file locallib.php.


| get_users_enrolments | ( | array $ | userids | ) |
Returns and array of users + enrolment details.
Given an array of user id's this function returns and array of user enrolments for those users as well as enough user information to display the users name and picture for each enrolment.
moodle_database $DB
| array | $userids |
Definition at line 954 of file locallib.php.

| get_users_for_display | ( | course_enrolment_manager $ | manager, |
| $ | sort, | ||
| $ | direction, | ||
| $ | page, | ||
| $ | perpage | ||
| ) |
Gets an array of users for display, this includes minimal user information as well as minimal information on the users roles, groups, and enrolments.
| core_enrol_renderer | $renderer | |
| moodle_url | $pageurl | |
| int | $sort | |
| string | $direction | ASC or DESC |
| int | $page | |
| int | $perpage |
Definition at line 823 of file locallib.php.

| has_instance | ( | $ | enrolpluginname | ) |
| remove_user_from_group | ( | $ | user, |
| $ | groupid | ||
| ) |
Removes a user from a group
moodle_database $DB
| StdClass | $user | |
| int | $groupid |
Definition at line 603 of file locallib.php.

| search_other_users | ( | $ | search = '', |
| $ | searchanywhere = false, |
||
| $ | page = 0, |
||
| $ | perpage = 25 |
||
| ) |
Searches other users and returns paginated results
moodle_database $DB
| string | $search | |
| bool | $searchanywhere | |
| int | $page | Starting at 0 |
| int | $perpage |
Definition at line 330 of file locallib.php.
| unassign_role_from_user | ( | $ | userid, |
| $ | roleid | ||
| ) |
Removes an assigned role from a user.
moodle_database $DB
| int | $userid | |
| int | $roleid |
Definition at line 546 of file locallib.php.

| unenrol_user | ( | $ | ue | ) |
Unenrols a user from the course given the users ue entry
moodle_database $DB
| stdClass | $ue |
Definition at line 506 of file locallib.php.

$context [protected] |
Definition at line 45 of file locallib.php.
$course = null [protected] |
Definition at line 50 of file locallib.php.
$instancefilter = null [protected] |
Definition at line 55 of file locallib.php.
$moodlepage = null [protected] |
Definition at line 88 of file locallib.php.
$otherusers = array() [protected] |
Definition at line 75 of file locallib.php.
$totalotherusers = null [protected] |
Definition at line 82 of file locallib.php.
$totalusers = null [protected] |
Definition at line 62 of file locallib.php.
$users = array() [protected] |
Definition at line 68 of file locallib.php.