ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLSLPEventHandler Class Reference

Handle LP-events. More...

+ Collaboration diagram for ilLSLPEventHandler:

Public Member Functions

 __construct (ilTree $tree, ilLPStatusWrapper $lp_status_wrapper)
 
 updateLPForChildEvent (array $parameter)
 

Protected Member Functions

 getParentLSO (int $child_ref_id)
 get the LSO up from $child_ref_if More...
 
 getRefIdsOfObjId (int $triggerer_obj_id)
 

Protected Attributes

 $tree
 
 $lpstatus
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLSLPEventHandler::__construct ( ilTree  $tree,
ilLPStatusWrapper  $lp_status_wrapper 
)

Definition at line 23 of file class.ilLSLPEventHandler.php.

26 {
27 $this->tree = $tree;
28 $this->lpstatus = $lp_status_wrapper;
29 }

References $tree.

Member Function Documentation

◆ getParentLSO()

ilLSLPEventHandler::getParentLSO ( int  $child_ref_id)
protected

get the LSO up from $child_ref_if

Returns
int | false;

Definition at line 48 of file class.ilLSLPEventHandler.php.

49 {
50 $path = $this->tree->getPathFull($child_ref_id);
51 if (!$path) {
52 return false;
53 }
54
55 foreach ($path as $hop) {
56 if ($hop['type'] === 'lso') {
57 return $hop;
58 }
59 }
60 return false;
61 }
$path
Definition: aliased.php:25

References $path.

Referenced by updateLPForChildEvent().

+ Here is the caller graph for this function:

◆ getRefIdsOfObjId()

ilLSLPEventHandler::getRefIdsOfObjId ( int  $triggerer_obj_id)
protected

Definition at line 63 of file class.ilLSLPEventHandler.php.

63 : array
64 {
65 return ilObject::_getAllReferences($triggerer_obj_id);
66 }
static _getAllReferences($a_id)
get all reference ids of object

References ilObject\_getAllReferences().

Referenced by updateLPForChildEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLPForChildEvent()

ilLSLPEventHandler::updateLPForChildEvent ( array  $parameter)

Definition at line 31 of file class.ilLSLPEventHandler.php.

32 {
33 $refs = $this->getRefIdsOfObjId((int) $parameter['obj_id']);
34 foreach ($refs as $ref_id) {
35 $lso_info = $this->getParentLSO((int) $ref_id);
36 if ($lso_info !== false) {
37 $obj_id = $lso_info['obj_id'];
38 $usr_id = $parameter['usr_id'];
39 $this->lpstatus::_refreshStatus($obj_id, [$usr_id]);
40 }
41 }
42 }
getParentLSO(int $child_ref_id)
get the LSO up from $child_ref_if
getRefIdsOfObjId(int $triggerer_obj_id)

References getParentLSO(), and getRefIdsOfObjId().

+ Here is the call graph for this function:

Field Documentation

◆ $lpstatus

ilLSLPEventHandler::$lpstatus
protected

Definition at line 20 of file class.ilLSLPEventHandler.php.

◆ $tree

ilLSLPEventHandler::$tree
protected

Definition at line 16 of file class.ilLSLPEventHandler.php.

Referenced by __construct().


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