ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilGroupLP.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27class ilGroupLP extends ilObjectLP
28{
29 public static function getDefaultModes(bool $a_lp_active): array
30 {
31 if (!$a_lp_active) {
32 return array(
34 );
35 } else {
36 return array(
39 );
40 }
41 }
42
43 public function getDefaultMode(): int
44 {
46 }
47
48 public function getValidModes(): array
49 {
50 return array(
54 );
55 }
56
57 public function getMembers(bool $a_search = true): array
58 {
59 $member_obj = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
60 return $member_obj->getMembers();
61 }
62
63 protected static function isLPMember(array &$a_res, int $a_usr_id, array $a_obj_ids): bool
64 {
65 global $DIC;
66
67 $ilDB = $DIC->database();
68
69 // will only find objects with roles for user!
70 // see ilParticipants::_getMembershipByType()
71 $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title" .
72 " FROM rbac_ua ua" .
73 " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)" .
74 " JOIN object_reference obr ON (fa.parent = obr.ref_id)" .
75 " JOIN object_data obd ON (obr.obj_id = obd.obj_id)" .
76 " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)" .
77 " WHERE obd.type = " . $ilDB->quote("grp", "text") .
78 " AND fa.assign = " . $ilDB->quote("y", "text") .
79 " AND ua.usr_id = " . $ilDB->quote($a_usr_id, "integer") .
80 " AND " . $ilDB->in("obd.obj_id", $a_obj_ids, false, "integer");
81 $set = $ilDB->query($query);
82 while ($row = $ilDB->fetchAssoc($set)) {
83 $role = $row["title"];
84 if (!stristr($role, "il_" . $row["type"] . "_admin_") &&
85 !stristr($role, "il_" . $row["type"] . "_tutor_")) {
86 $a_res[$row["obj_id"]] = true;
87 }
88 }
89 return true;
90 }
91}
getMembers(bool $a_search=true)
static getDefaultModes(bool $a_lp_active)
Get available type-specific default modes (no administration needed)
static isLPMember(array &$a_res, int $a_usr_id, array $a_obj_ids)
Find (lp-relevant) members for given object ids.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
Base class for object lp connectors.
global $DIC
Definition: shib_login.php:26