ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTrackingAppEventListener Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTrackingAppEventListener:
+ Collaboration diagram for ilTrackingAppEventListener:

Static Public Member Functions

static handleEvent (string $a_component, string $a_event, array $a_parameter)
 Handle an event in a listener. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Update lp data from Services/Object events

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 28 of file class.ilTrackingAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilTrackingAppEventListener::handleEvent ( string  $a_component,
string  $a_event,
array  $a_parameter 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Modules/Forum" or "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

Implements ilAppEventListener.

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

References ilObject\_getAllReferences(), ilLPStatusWrapper\_updateStatus(), ilObjectLP\getInstance(), and ilObjectLP\handleMove().

40  : void {
41  $obj_id = $a_parameter['obj_id'] ?? null;
42  switch ($a_component) {
43  case 'Services/Object':
44  switch ($a_event) {
45  case 'toTrash':
46  $olp = ilObjectLP::getInstance($obj_id);
47  $olp->handleToTrash();
48  break;
49 
50  case 'delete':
51  // ilRepUtil will raise "delete" even if only reference was deleted!
52  $all_ref = ilObject::_getAllReferences($obj_id);
53  if (!sizeof($all_ref)) {
54  $olp = ilObjectLP::getInstance($obj_id);
55  $olp->handleDelete();
56  }
57  break;
58  }
59  break;
60 
61  case 'Services/Tree':
62  switch ($a_event) {
63  case 'moveTree':
64  if ($a_parameter['tree'] == 'tree') {
65  ilObjectLP::handleMove($a_parameter['source_id']);
66  }
67  break;
68  }
69  break;
70 
71  case 'Modules/Group':
72  case 'Modules/Course':
73  case 'Modules/LearningSequence':
74  switch ($a_event) {
75  case 'addParticipant':
76  ilLPStatusWrapper::_updateStatus((int) $obj_id, (int) ($a_parameter['usr_id'] ?? 0));
77  break;
78  }
79  }
80  }
static handleMove(int $source_ref_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstance(int $obj_id)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:

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