ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLSLPEventHandler Class Reference

Handle LP-events. More...

+ Inheritance diagram for ilLSLPEventHandler:
+ Collaboration diagram for ilLSLPEventHandler:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

 $tree
 
 $lpstatus
 
 $cached_parent_lso = []
 
 $cached_refs_for_obj = []
 

Private Member Functions

 getParentLSOIdFromTree (int $child_ref_id)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $tree.

35  {
36  $this->tree = $tree;
37  $this->lpstatus = $lp_status_wrapper;
38  }

Member Function Documentation

◆ getParentLSOIdFromTree()

ilLSLPEventHandler::getParentLSOIdFromTree ( int  $child_ref_id)
private

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

Referenced by getParentLSOObjId().

65  {
66  $parent_nd = $this->tree->getParentNodeData($child_ref_id);
67  if ($parent_nd['type'] === 'lso') {
68  return $parent_nd['obj_id'];
69  }
70  return false;
71  }
+ Here is the caller graph for this function:

◆ getParentLSOObjId()

ilLSLPEventHandler::getParentLSOObjId ( int  $child_ref_id)
protected

get the LSO up from $child_ref_if

Returns
int | false;

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

References getParentLSOIdFromTree().

Referenced by updateLPForChildEvent().

57  {
58  if (!array_key_exists($child_ref_id, $this->cached_parent_lso)) {
59  $this->cached_parent_lso[$child_ref_id] = $this->getParentLSOIdFromTree($child_ref_id);
60  }
61  return $this->cached_parent_lso[$child_ref_id];
62  }
getParentLSOIdFromTree(int $child_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRefIdsOfObjId()

ilLSLPEventHandler::getRefIdsOfObjId ( int  $triggerer_obj_id)
protected

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

References ilObject\_getAllReferences().

Referenced by updateLPForChildEvent().

73  : array
74  {
75  if (!array_key_exists($triggerer_obj_id, $this->cached_refs_for_obj)) {
76  $this->cached_refs_for_obj[$triggerer_obj_id] = ilObject::_getAllReferences($triggerer_obj_id);
77  }
78  return $this->cached_refs_for_obj[$triggerer_obj_id];
79  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLPForChildEvent()

ilLSLPEventHandler::updateLPForChildEvent ( array  $parameter)

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

References getParentLSOObjId(), and getRefIdsOfObjId().

41  {
42  $refs = $this->getRefIdsOfObjId((int) $parameter['obj_id']);
43  foreach ($refs as $ref_id) {
44  $lso_id = $this->getParentLSOObjId((int) $ref_id);
45  if ($lso_id !== false) {
46  $usr_id = $parameter['usr_id'];
47  $this->lpstatus::_updateStatus($lso_id, $usr_id);
48  }
49  }
50  }
getParentLSOObjId(int $child_ref_id)
get the LSO up from $child_ref_if
getRefIdsOfObjId(int $triggerer_obj_id)
+ Here is the call graph for this function:

Field Documentation

◆ $cached_parent_lso

ilLSLPEventHandler::$cached_parent_lso = []
protected

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

◆ $cached_refs_for_obj

ilLSLPEventHandler::$cached_refs_for_obj = []
protected

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

◆ $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: