ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLPStatusCollection Class Reference
+ Inheritance diagram for ilLPStatusCollection:
+ Collaboration diagram for ilLPStatusCollection:

Public Member Functions

 __construct ($a_obj_id)
 
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status. More...
 
- Public Member Functions inherited from ilLPStatus
 __construct ($a_obj_id)
 
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) More...
 
 determinePercentage ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine percentage. More...
 
 determineStatus ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine status. More...
 
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh status. More...
 

Static Public Member Functions

static _getNotAttempted ($a_obj_id)
 
static _getInProgress ($a_obj_id)
 
static _getCompleted ($a_obj_id)
 Get completed users New handling for optional grouped assignments. More...
 
static _getFailed ($a_obj_id)
 
static _getStatusInfo ($a_obj_id)
 
static _getTypicalLearningTime ($a_obj_id)
 
static determineGroupingStatus ($status, $gr_info, $user_id, $is_grouping)
 Determine grouping status $ilObjDataCache. More...
 
static _lookupCompletedForObject ($a_obj_id, $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject ($a_obj_id, $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject ($a_obj_id, $a_user_ids=null)
 Get in progress users for object. More...
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted ($a_obj_id)
 
static _getNotAttempted ($a_obj_id)
 
static _getCountInProgress ($a_obj_id)
 
static _getInProgress ($a_obj_id)
 
static _getCountCompleted ($a_obj_id)
 
static _getCompleted ($a_obj_id)
 
static _getFailed ($a_obj_id)
 
static _getCountFailed ()
 
static _getStatusInfo ($a_obj_id)
 
static _getTypicalLearningTime ($a_obj_id)
 
static checkStatusForObject ($a_obj_id, $a_users=false)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus ($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false, &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted ($a_obj_id, $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty ($a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus ($a_obj_id, $a_user_id, $a_create=true)
 Lookup status. More...
 
static _lookupPercentage ($a_obj_id, $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted ($a_obj_id, $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject ($a_obj_id, $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject ($a_obj_id, $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject ($a_obj_id, $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData ($a_obj_ids)
 
static getListGUIStatus ($a_obj_id, $a_image_only=true)
 

Protected Member Functions

 isMember (int $objId, int $usrId)
 

Static Protected Member Functions

static getMembers ($a_obj_id)
 Get members for object. More...
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_old_status, $a_percentage)
 
static _lookupStatusForObject ($a_obj_id, $a_status, $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects ($a_user_id, $a_obj_ids, $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects ($a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects ($a_user_id, $a_obj_ids)
 Get LP status for given objects (and user) More...
 

Protected Attributes

 $ilObjDataCache
 
- Protected Attributes inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 

Private Attributes

 $tree
 

Additional Inherited Members

- Data Fields inherited from ilLPStatus
const LP_STATUS_NOT_ATTEMPTED = 'trac_no_attempted'
 
const LP_STATUS_IN_PROGRESS = 'trac_in_progress'
 
const LP_STATUS_COMPLETED = 'trac_completed'
 
const LP_STATUS_FAILED = 'trac_failed'
 
const LP_STATUS_NOT_ATTEMPTED_NUM = 0
 
const LP_STATUS_IN_PROGRESS_NUM = 1
 
const LP_STATUS_COMPLETED_NUM = 2
 
const LP_STATUS_FAILED_NUM = 3
 
const LP_STATUS_REGISTERED = 'trac_registered'
 
const LP_STATUS_NOT_REGISTERED = 'trac_not_registered'
 
const LP_STATUS_PARTICIPATED = 'trac_participated'
 
const LP_STATUS_NOT_PARTICIPATED = 'trac_not_participated'
 
- Static Public Attributes inherited from ilLPStatus
static $list_gui_cache
 

Detailed Description

Definition at line 36 of file class.ilLPStatusCollection.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPStatusCollection::__construct (   $a_obj_id)

Definition at line 42 of file class.ilLPStatusCollection.php.

References $DIC, $ilDB, and ILIAS\GlobalScreen\Provider\__construct().

43  {
44  global $DIC;
45 
46  $ilDB = $DIC['ilDB'];
47 
48  parent::__construct($a_obj_id);
49  $this->db = $ilDB;
50  $this->tree = $DIC->repositoryTree();
51  $this->ilObjDataCache = $DIC['ilObjDataCache'];
52  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ _getCompleted()

static ilLPStatusCollection::_getCompleted (   $a_obj_id)
static

Get completed users New handling for optional grouped assignments.

Parameters
int$a_obj_id
Returns
array users

Definition at line 108 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), and ilObjectLP\getInstance().

109  {
110  global $DIC;
111 
112  $ilObjDataCache = $DIC['ilObjDataCache'];
113 
114  include_once './Services/Object/classes/class.ilObjectLP.php';
115  $olp = ilObjectLP::getInstance($a_obj_id);
116  $collection = $olp->getCollectionInstance();
117  if ($collection) {
118  $grouped_items = $collection->getGroupedItemsForLPStatus();
119  }
120  if (!sizeof($grouped_items)) {
121  // #11513 - empty collections cannot be completed
122  return array();
123  } else {
124  // New handling for optional assignments
125  $counter = 0;
126  $users = array();
127  foreach ($grouped_items as $grouping_id => $grouping) {
128  $isGrouping = $grouping_id ? true : false;
129  $grouping_completed = array();
130  $grouping_completed_users_num = array();
131  foreach ((array) $grouping['items'] as $item) {
132  $item_id = $ilObjDataCache->lookupObjId($item);
133  $tmp_users = ilLPStatusWrapper::_getCompleted($item_id);
134  if ($isGrouping) {
135  // Iterated through all grouped items and count the number of fullfiled items
136  foreach ($tmp_users as $tmp_user_id) {
137  ++$grouping_completed_users_num[$tmp_user_id];
138  }
139  } else {
140  if (!$counter++) {
141  $users = $tmp_users;
142  } else {
143  $users = array_intersect($users, $tmp_users);
144  }
145  }
146  }
147  if ($isGrouping) {
148  // Iterate through all "grouping_completed_users_num"
149  // All users with completed items greater equal than "num_obligatory" are completed
150  foreach ($grouping_completed_users_num as $tmp_user_id => $grouping_num_completed) {
151  if ($grouping_num_completed >= $grouping['num_obligatory']) {
152  $grouping_completed[] = $tmp_user_id;
153  }
154  }
155 
156  // build intersection of users
157  if (!$counter++) {
158  $users = $grouping_completed;
159  } else {
160  $users = array_intersect($users, $grouping_completed);
161  }
162  }
163  }
164  }
165 
166  $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
167 
168  if ($users) {
169  // Exclude all non members
170  $users = array_intersect(self::getMembers($a_obj_id), (array) $users);
171  }
172 
173  return (array) $users;
174  }
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
global $DIC
Definition: goto.php:24
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusCollection::_getFailed (   $a_obj_id)
static

Definition at line 176 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, ilLPStatusWrapper\_getFailed(), and ilObjectLP\getInstance().

177  {
178  global $DIC;
179 
180  $ilObjDataCache = $DIC['ilObjDataCache'];
181 
182  $users = array();
183 
184  include_once './Services/Object/classes/class.ilObjectLP.php';
185  $olp = ilObjectLP::getInstance($a_obj_id);
186  $collection = $olp->getCollectionInstance();
187  if ($collection) {
188  foreach ($collection->getGroupedItemsForLPStatus() as $grouping_id => $grouping) {
189  $isGrouping = $grouping_id ? true : false;
190 
191  $gr_failed = array();
192  $gr_failed_users_num = array();
193  $counter = 0;
194  foreach ((array) $grouping['items'] as $item) {
195  $item_id = $ilObjDataCache->lookupObjId($item);
196  $tmp_users = ilLPStatusWrapper::_getFailed($item_id);
197 
198  if ($isGrouping) {
199  foreach ($tmp_users as $tmp_user_id) {
200  ++$gr_failed_users_num[$tmp_user_id];
201  }
202  } else {
203  // One item failed is sufficient for status failed.
204  $gr_failed = array_merge($gr_failed, $tmp_users);
205  }
206  $counter++;
207  }
208  if ($isGrouping) {
209  $allowed_failed = count($grouping['items']) - $grouping['num_obligatory'];
210  // Itereate over all failed users and check whether the allowd_failed value exceeded
211  foreach ($gr_failed_users_num as $tmp_user_id => $num_failed) {
212  if ($num_failed > $allowed_failed) {
213  $gr_failed[] = $tmp_user_id;
214  }
215  }
216  }
217  $users = array_unique(array_merge($users, $gr_failed));
218  }
219  }
220 
221  if ($users) {
222  // Exclude all non members
223  $users = array_intersect(self::getMembers($a_obj_id), (array) $users);
224  }
225 
226  return array_unique($users);
227  }
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
global $DIC
Definition: goto.php:24
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusCollection::_getInProgress (   $a_obj_id)
static

Definition at line 70 of file class.ilLPStatusCollection.php.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), ilObject\_lookupObjId(), ilObjectLP\getInstance(), and ilChangeEvent\lookupUsersInProgress().

71  {
72  include_once './Services/Tracking/classes/class.ilChangeEvent.php';
73  $users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
74 
75  include_once './Services/Object/classes/class.ilObjectLP.php';
76  $olp = ilObjectLP::getInstance($a_obj_id);
77  $collection = $olp->getCollectionInstance();
78  if ($collection) {
79  foreach ($collection->getItems() as $item_id) {
80  $item_id = ilObject::_lookupObjId($item_id);
81 
82  // merge arrays of users with status 'in progress'
83  $users = array_unique(array_merge((array) $users, ilLPStatusWrapper::_getInProgress($item_id)));
84  $users = array_unique(array_merge((array) $users, ilLPStatusWrapper::_getCompleted($item_id)));
85  }
86  }
87 
88  // Exclude all users with status completed.
89  $users = array_diff((array) $users, ilLPStatusWrapper::_getCompleted($a_obj_id));
90  // Exclude all users with status failed.
91  $users = array_diff((array) $users, ilLPStatusWrapper::_getFailed($a_obj_id));
92 
93  if ($users) {
94  // Exclude all non members
95  $users = array_intersect(self::getMembers($a_obj_id), (array) $users);
96  }
97 
98  return $users;
99  }
static _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
static _lookupObjId($a_id)
static getInstance($a_obj_id)
static lookupUsersInProgress($a_obj_id)
Lookup users in progress.
+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusCollection::_getNotAttempted (   $a_obj_id)
static

Definition at line 55 of file class.ilLPStatusCollection.php.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), and ilLPStatusWrapper\_getInProgress().

55  : array
56  {
57  $users = array();
58 
59  $members = self::getMembers($a_obj_id);
60  if ($members) {
61  // diff in progress and completed (use stored result in LPStatusWrapper)
62  $users = array_diff((array) $members, ilLPStatusWrapper::_getInProgress($a_obj_id));
63  $users = array_diff((array) $users, ilLPStatusWrapper::_getCompleted($a_obj_id));
64  $users = array_diff((array) $users, ilLPStatusWrapper::_getFailed($a_obj_id));
65  }
66 
67  return $users;
68  }
static _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusCollection::_getStatusInfo (   $a_obj_id)
static

Definition at line 229 of file class.ilLPStatusCollection.php.

References ilObjectLP\getInstance().

230  {
231  $status_info = array();
232 
233  include_once './Services/Object/classes/class.ilObjectLP.php';
234  $olp = ilObjectLP::getInstance($a_obj_id);
235  $collection = $olp->getCollectionInstance();
236  if ($collection) {
237  $status_info['collections'] = $collection->getItems();
238  $status_info['num_collections'] = count($status_info['collections']);
239  }
240 
241  return $status_info;
242  }
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ _getTypicalLearningTime()

static ilLPStatusCollection::_getTypicalLearningTime (   $a_obj_id)
static

Definition at line 244 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, ilLPStatusWrapper\_getStatusInfo(), and ilLPStatusWrapper\_getTypicalLearningTime().

245  {
246  global $DIC;
247 
248  $ilObjDataCache = $DIC['ilObjDataCache'];
249 
250  if ($ilObjDataCache->lookupType($a_obj_id) == 'sahs') {
251  return parent::_getTypicalLearningTime($a_obj_id);
252  }
253 
254  $tlt = 0;
255  $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
256  foreach ($status_info['collections'] as $item) {
257  $tlt += ilLPStatusWrapper::_getTypicalLearningTime($ilObjDataCache->lookupObjId($item));
258  }
259  return $tlt;
260  }
global $DIC
Definition: goto.php:24
static _getStatusInfo($a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
static _getTypicalLearningTime($a_obj_id)
Reads Typical learning time.
+ Here is the call graph for this function:

◆ _lookupCompletedForObject()

static ilLPStatusCollection::_lookupCompletedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get completed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Definition at line 463 of file class.ilLPStatusCollection.php.

464  {
465  if (!$a_user_ids) {
466  $a_user_ids = self::getMembers($a_obj_id);
467  if (!$a_user_ids) {
468  return array();
469  }
470  }
471  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
472  }

◆ _lookupFailedForObject()

static ilLPStatusCollection::_lookupFailedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get failed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Definition at line 481 of file class.ilLPStatusCollection.php.

482  {
483  if (!$a_user_ids) {
484  $a_user_ids = self::getMembers($a_obj_id);
485  if (!$a_user_ids) {
486  return array();
487  }
488  }
489  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_FAILED_NUM, $a_user_ids);
490  }

◆ _lookupInProgressForObject()

static ilLPStatusCollection::_lookupInProgressForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get in progress users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Definition at line 499 of file class.ilLPStatusCollection.php.

500  {
501  if (!$a_user_ids) {
502  $a_user_ids = self::getMembers($a_obj_id);
503  if (!$a_user_ids) {
504  return array();
505  }
506  }
507  return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
508  }

◆ determineGroupingStatus()

static ilLPStatusCollection::determineGroupingStatus (   $status,
  $gr_info,
  $user_id,
  $is_grouping 
)
static

Determine grouping status $ilObjDataCache.

Parameters
array$status
array$items
int$user_id
boolean$is_grouping
Returns
boolean

Definition at line 335 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, and ilLPStatusWrapper\_determineStatus().

336  {
337  global $DIC;
338 
339  $ilObjDataCache = $DIC['ilObjDataCache'];
340 
341  $items = $gr_info['items'];
342  if ($is_grouping) {
343  $max_allowed_failed = count($items) - $gr_info['num_obligatory'];
344  $required_completed = $gr_info['num_obligatory'];
345  } else {
346  $max_allowed_failed = 0;
347  $required_completed = count($items);
348  }
349 
350  // Required for grouping with a number of obligatory items
351  $num_failed = 0;
352  $num_completed = 0;
353 
354  foreach ($items as $item_id) {
355  $item_id = $ilObjDataCache->lookupObjId($item_id);
356  $gr_status = ilLPStatusWrapper::_determineStatus($item_id, $user_id);
357 
358  if ($gr_status == self::LP_STATUS_FAILED_NUM) {
359  if (++$num_failed > $max_allowed_failed) {
360  $status['failed'] = true;
361  $status['completed'] = false;
362  return $status;
363  }
364  }
365  if ($gr_status == self::LP_STATUS_COMPLETED_NUM) {
366  if (++$num_completed >= $required_completed) {
367  return $status;
368  }
369  }
370  }
371  // Not completed since returned above
372  $status['completed'] = false;
373  return $status;
374  }
global $DIC
Definition: goto.php:24
static _determineStatus($a_obj_id, $a_usr_id)
Determine status.
+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusCollection::determineStatus (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine status.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer status

Definition at line 270 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, ilObjectLP\getInstance(), ilChangeEvent\hasAccessed(), and isMember().

271  {
272  global $DIC;
273 
274  $ilObjDataCache = $DIC['ilObjDataCache'];
275 
276  $status['completed'] = true;
277  $status['failed'] = false;
278  $status['in_progress'] = false;
279 
280  switch ($ilObjDataCache->lookupType($a_obj_id)) {
281  case "crs":
282  case "fold":
283  case "grp":
284  case "lso":
285  include_once "./Services/Tracking/classes/class.ilChangeEvent.php";
286  if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id)) {
287  $status['in_progress'] = true;
288  }
289 
290  include_once './Services/Object/classes/class.ilObjectLP.php';
291  $olp = ilObjectLP::getInstance($a_obj_id);
292  $collection = $olp->getCollectionInstance();
293  if ($collection) {
294  $grouped_items = $collection->getGroupedItemsForLPStatus();
295  }
296  if (!sizeof($grouped_items)) {
297  // #11513 - empty collections cannot be completed
298  $status['completed'] = false;
299  } else {
300  foreach ($grouped_items as $grouping_id => $grouping) {
301  $isGrouping = $grouping_id ? true : false;
302  $status = self::determineGroupingStatus($status, $grouping, $a_user_id, $isGrouping);
303  }
304  }
305 
306  if ($status['completed']) {
307  if (!$this->isMember((int) $a_obj_id, (int) $a_user_id)) {
308  return self::LP_STATUS_IN_PROGRESS_NUM;
309  }
310 
311  return self::LP_STATUS_COMPLETED_NUM;
312  }
313 
314  if ($status['failed']) {
315  return self::LP_STATUS_FAILED_NUM;
316  }
317 
318  if ($status['in_progress']) {
319  return self::LP_STATUS_IN_PROGRESS_NUM;
320  }
321  break;
322  }
323  return self::LP_STATUS_NOT_ATTEMPTED_NUM;
324  }
static hasAccessed($a_obj_id, $a_usr_id)
Has accessed.
isMember(int $objId, int $usrId)
global $DIC
Definition: goto.php:24
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ getMembers()

static ilLPStatusCollection::getMembers (   $a_obj_id)
staticprotected

Get members for object.

Parameters
int$a_obj_id
Returns
array

Definition at line 419 of file class.ilLPStatusCollection.php.

References $DIC, $ilObjDataCache, $tree, ilObject\_getAllReferences(), ilLearningSequenceParticipants\_getInstanceByObjId(), ilGroupParticipants\_getInstanceByObjId(), ilCourseParticipants\_getInstanceByObjId(), and ilObject\_lookupObjId().

420  {
421  global $DIC;
422 
423  $ilObjDataCache = $DIC['ilObjDataCache'];
424  $tree = $DIC['tree'];
425 
426  switch ($ilObjDataCache->lookupType($a_obj_id)) {
427  case 'crs':
428  include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
429  $member_obj = ilCourseParticipants::_getInstanceByObjId($a_obj_id);
430  return $member_obj->getMembers();
431 
432  case 'grp':
433  include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
434  $member_obj = ilGroupParticipants::_getInstanceByObjId($a_obj_id);
435  return $member_obj->getMembers();
436 
437  case 'fold':
438  $folder_ref_ids = ilObject::_getAllReferences($a_obj_id);
439  $folder_ref_id = current($folder_ref_ids);
440  if ($crs_id = $tree->checkForParentType($folder_ref_id, 'crs')) {
441  include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
443  return $member_obj->getMembers();
444  }
445  break;
446 
447  case 'lso':
449  return $member_obj->getMembers();
450  break;
451  }
452 
453  return array();
454  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:

◆ isMember()

ilLPStatusCollection::isMember ( int  $objId,
int  $usrId 
)
protected
Parameters
int$objId
int$usrId
Returns
bool

Definition at line 381 of file class.ilLPStatusCollection.php.

References ilObject\_getAllReferences(), ilLearningSequenceParticipants\_getInstanceByObjId(), ilGroupParticipants\_getInstanceByObjId(), ilCourseParticipant\_getInstanceByObjId(), and ilObject\_lookupObjId().

Referenced by determineStatus().

381  : bool
382  {
383  switch ($this->ilObjDataCache->lookupType($objId)) {
384  case 'crs':
385  $participants = ilCourseParticipant::_getInstanceByObjId($objId, $usrId);
386  return $participants->isMember();
387 
388  case 'grp':
390  return $participants->isMember($usrId);
391 
392  case 'fold':
393  $folderRefIds = ilObject::_getAllReferences($objId);
394  $folderRefId = current($folderRefIds);
395  if ($crsRefId = $this->tree->checkForParentType($folderRefId, 'crs')) {
396  $participants = ilCourseParticipant::_getInstanceByObjId(ilObject::_lookupObjId($crsRefId), $usrId);
397  return $participants->isMember();
398  }
399 
400  if ($grpRefId = $this->tree->checkForParentType($folderRefId, 'grp')) {
402  return $participants->isMember($usrId);
403  }
404  break;
405 
406  case 'lso':
408  return $participants->isMember($usrId);
409  }
410 
411  return true;
412  }
$objId
Definition: xapitoken.php:39
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjId($a_id)
static _getInstanceByObjId($a_obj_id, $a_usr_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ilObjDataCache

ilLPStatusCollection::$ilObjDataCache
protected

◆ $tree

ilLPStatusCollection::$tree
private

Definition at line 38 of file class.ilLPStatusCollection.php.

Referenced by getMembers().


The documentation for this class was generated from the following file: