Class used to fetch participants based on a filterset.
More...
|
context_course | $context |
| $context The course context being searched.
|
|
stdClass | $course |
| $course The course being searched.
|
|
filterset | $filterset |
| $filterset The filterset describing which participants to include in the search.
|
|
string[] | $userfields |
| $userfields Names of any extra user fields to be shown when listing users.
|
|
Class used to fetch participants based on a filterset.
- Copyright
- 2020 Michael Hawkins micha.nosp@m.elh@.nosp@m.moodl.nosp@m.e.co.nosp@m.m
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_user\table\participants_search::__construct |
( |
stdClass |
$course, |
|
|
context |
$context, |
|
|
filterset |
$filterset |
|
) |
| |
Class constructor.
- Parameters
-
stdClass | $course | The course being searched. |
context | $context | The context of the search. |
filterset | $filterset | The filterset used to filter the participants in a course. |
◆ get_enrol_method_sql()
core_user\table\participants_search::get_enrol_method_sql |
( |
|
$useridcolumn | ) |
|
|
protected |
Prepare the enrolment methods filter SQL content.
- Parameters
-
string | $useridcolumn | User ID column used in the calling query, e.g. u.id |
- Return values
-
array | SQL query data in the format ['joins' => [], 'where' => '', 'params' => []]. |
◆ get_enrolled_sql()
core_user\table\participants_search::get_enrolled_sql |
( |
| ) |
|
|
protected |
Prepare SQL and associated parameters for users enrolled in the course.
- Return values
-
array | SQL query data in the format ['sql' => '', 'forcedsql' => '', 'params' => []]. |
◆ get_groups_jointype()
core_user\table\participants_search::get_groups_jointype |
( |
?int |
$forcedjointype = null | ) |
|
|
protected |
Fetch the groups filter's grouplib jointype, based on its filterset jointype.
This mapping is to ensure compatibility between the two, should their values ever differ.
- Parameters
-
int | null | $forcedjointype | If set, specifies the join type to fetch mapping for (used when applying forced filtering). If null, then user defined filter join type is used. |
- Return values
-
◆ get_keywords_search_sql()
core_user\table\participants_search::get_keywords_search_sql |
( |
| ) |
|
|
protected |
Prepare SQL where clause and associated parameters for any keyword searches being performed.
- Return values
-
array | SQL query data in the format ['where' => '', 'params' => []]. |
◆ get_participants()
core_user\table\participants_search::get_participants |
( |
string |
$additionalwhere = '' , |
|
|
array |
$additionalparams = [] , |
|
|
string |
$sort = '' , |
|
|
int |
$limitfrom = 0 , |
|
|
int |
$limitnum = 0 |
|
) |
| |
Fetch participants matching the filterset.
- Parameters
-
string | $additionalwhere | Any additional SQL to add to where. |
array | $additionalparams | The additional params used by $additionalwhere. |
string | $sort | Optional SQL sort. |
int | $limitfrom | Return a subset of records, starting at this point (optional). |
int | $limitnum | Return a subset comprising this many records (optional, required if $limitfrom is set). |
- Return values
-
◆ get_participants_sql()
core_user\table\participants_search::get_participants_sql |
( |
string |
$additionalwhere, |
|
|
array |
$additionalparams |
|
) |
| |
|
protected |
Generate the SQL used to fetch filtered data for the participants table.
- Parameters
-
string | $additionalwhere | Any additional SQL to add to where |
array | $additionalparams | The additional params |
- Return values
-
◆ get_roles_sql()
core_user\table\participants_search::get_roles_sql |
( |
| ) |
|
|
protected |
Prepare SQL where clause and associated parameters for any roles filtering being performed.
- Return values
-
array | SQL query data in the format ['where' => '', 'params' => []]. |
◆ get_status_sql()
core_user\table\participants_search::get_status_sql |
( |
|
$filteruidcolumn, |
|
|
|
$forceduidcolumn, |
|
|
|
$forcedprefix |
|
) |
| |
|
protected |
Prepare the status filter SQL content.
Note: Users who cannot view suspended users will always have their results filtered to only show active participants.
- Parameters
-
string | $filteruidcolumn | User ID column used in the calling query, e.g. eu_u.id |
string | $forceduidcolumn | User ID column used in any forced query, e.g. feu_u.id |
string | $forcedprefix | The prefix to use if forced filtering is required |
- Return values
-
array | SQL query data in the format ['joins' => [], 'where' => '', 'params' => [], 'forcestatus' => true] |
◆ get_total_participants_count()
core_user\table\participants_search::get_total_participants_count |
( |
string |
$additionalwhere = '' , |
|
|
array |
$additionalparams = [] |
|
) |
| |
Returns the total number of participants for a given course.
- Parameters
-
string | $additionalwhere | Any additional SQL to add to where. |
array | $additionalparams | The additional params used by $additionalwhere. |
- Return values
-
The documentation for this class was generated from the following file: