| Línea 1192... |
Línea 1192... |
| 1192 |
* @param context $context Course context or a context within a course. Mandatory when $groupid = USERSWITHOUTGROUP
|
1192 |
* @param context $context Course context or a context within a course. Mandatory when $groupid = USERSWITHOUTGROUP
|
| 1193 |
* @param int $groupsjointype Join type logic used. Defaults to 'Any' (logical OR).
|
1193 |
* @param int $groupsjointype Join type logic used. Defaults to 'Any' (logical OR).
|
| 1194 |
* @return array($sql, $params)
|
1194 |
* @return array($sql, $params)
|
| 1195 |
* @throws coding_exception if empty or invalid context submitted when $groupid = USERSWITHOUTGROUP
|
1195 |
* @throws coding_exception if empty or invalid context submitted when $groupid = USERSWITHOUTGROUP
|
| 1196 |
*/
|
1196 |
*/
|
| 1197 |
function groups_get_members_ids_sql($groupids, context $context = null, $groupsjointype = GROUPS_JOIN_ANY) {
|
1197 |
function groups_get_members_ids_sql($groupids, ?context $context = null, $groupsjointype = GROUPS_JOIN_ANY) {
|
| 1198 |
if (!is_array($groupids)) {
|
1198 |
if (!is_array($groupids)) {
|
| 1199 |
$groupids = [$groupids];
|
1199 |
$groupids = [$groupids];
|
| 1200 |
}
|
1200 |
}
|
| Línea 1201... |
Línea 1201... |
| 1201 |
|
1201 |
|
| Línea 1252... |
Línea 1252... |
| 1252 |
* @param context $context Course context or a context within a course. Mandatory when $groupids includes USERSWITHOUTGROUP
|
1252 |
* @param context $context Course context or a context within a course. Mandatory when $groupids includes USERSWITHOUTGROUP
|
| 1253 |
* @param int $jointype Join type logic used. Defaults to 'Any' (logical OR).
|
1253 |
* @param int $jointype Join type logic used. Defaults to 'Any' (logical OR).
|
| 1254 |
* @return \core\dml\sql_join Contains joins, wheres, params
|
1254 |
* @return \core\dml\sql_join Contains joins, wheres, params
|
| 1255 |
* @throws coding_exception if empty or invalid context submitted when $groupid = USERSWITHOUTGROUP
|
1255 |
* @throws coding_exception if empty or invalid context submitted when $groupid = USERSWITHOUTGROUP
|
| 1256 |
*/
|
1256 |
*/
|
| 1257 |
function groups_get_members_join($groupids, $useridcolumn, context $context = null, int $jointype = GROUPS_JOIN_ANY) {
|
1257 |
function groups_get_members_join($groupids, $useridcolumn, ?context $context = null, int $jointype = GROUPS_JOIN_ANY) {
|
| 1258 |
global $DB;
|
1258 |
global $DB;
|
| Línea 1259... |
Línea 1259... |
| 1259 |
|
1259 |
|
| 1260 |
// Use unique prefix just in case somebody makes some SQL magic with the result.
|
1260 |
// Use unique prefix just in case somebody makes some SQL magic with the result.
|
| 1261 |
static $i = 0;
|
1261 |
static $i = 0;
|
| Línea 1472... |
Línea 1472... |
| 1472 |
*
|
1472 |
*
|
| 1473 |
* @param int $courseid The course id to cache data for.
|
1473 |
* @param int $courseid The course id to cache data for.
|
| 1474 |
* @param cache $cache The cache if it has already been initialised. If not a new one will be created.
|
1474 |
* @param cache $cache The cache if it has already been initialised. If not a new one will be created.
|
| 1475 |
* @return stdClass A data object containing groups, groupings, and mappings.
|
1475 |
* @return stdClass A data object containing groups, groupings, and mappings.
|
| 1476 |
*/
|
1476 |
*/
|
| 1477 |
function groups_cache_groupdata($courseid, cache $cache = null) {
|
1477 |
function groups_cache_groupdata($courseid, ?cache $cache = null) {
|
| 1478 |
global $DB;
|
1478 |
global $DB;
|
| Línea 1479... |
Línea 1479... |
| 1479 |
|
1479 |
|
| 1480 |
if ($cache === null) {
|
1480 |
if ($cache === null) {
|
| 1481 |
// Initialise a cache if we wern't given one.
|
1481 |
// Initialise a cache if we wern't given one.
|
| Línea 1529... |
Línea 1529... |
| 1529 |
*
|
1529 |
*
|
| 1530 |
* @param int $courseid The course id to get data for.
|
1530 |
* @param int $courseid The course id to get data for.
|
| 1531 |
* @param cache $cache The cache if it has already been initialised. If not a new one will be created.
|
1531 |
* @param cache $cache The cache if it has already been initialised. If not a new one will be created.
|
| 1532 |
* @return stdClass
|
1532 |
* @return stdClass
|
| 1533 |
*/
|
1533 |
*/
|
| 1534 |
function groups_get_course_data($courseid, cache $cache = null) {
|
1534 |
function groups_get_course_data($courseid, ?cache $cache = null) {
|
| 1535 |
if ($cache === null) {
|
1535 |
if ($cache === null) {
|
| 1536 |
// Initialise a cache if we wern't given one.
|
1536 |
// Initialise a cache if we wern't given one.
|
| 1537 |
$cache = cache::make('core', 'groupdata');
|
1537 |
$cache = cache::make('core', 'groupdata');
|
| 1538 |
}
|
1538 |
}
|
| 1539 |
// Try to retrieve it from the cache.
|
1539 |
// Try to retrieve it from the cache.
|