ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTrackingAppEventListener Class Reference

Update lp data from Services/Object events. More...

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

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_params)
 Handle an event in a listener.

Static Protected Member Functions

static handleToTrash ($a_obj_id)
static handleDelete ($a_obj_id)
static updateParentCollections ($a_obj_id)

Detailed Description

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 14 of file class.ilTrackingAppEventListener.php.

Member Function Documentation

static ilTrackingAppEventListener::handleDelete (   $a_obj_id)
staticprotected

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

References ilChangeEvent\_delete(), ilLPCollections\_deleteAll(), ilLPMarks\deleteObject(), and updateParentCollections().

Referenced by handleEvent().

{
include_once "Services/Tracking/classes/class.ilLPMarks.php";
include_once "Services/Tracking/classes/class.ilChangeEvent.php";
include_once "Services/Tracking/classes/class.ilLPCollections.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilTrackingAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_params 
)
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 23 of file class.ilTrackingAppEventListener.php.

References ilObject\_getAllReferences(), handleDelete(), and handleToTrash().

{
$obj_id = $a_params['obj_id'];
// #11514
switch($a_component)
{
case 'Services/Object':
switch($a_event)
{
case 'toTrash':
break;
case 'delete':
// ilRepUtil will raise "delete" even if only reference was deleted!
$all_ref = ilObject::_getAllReferences($obj_id);
if(!sizeof($all_ref))
{
}
break;
}
break;
}
return true;
}

+ Here is the call graph for this function:

static ilTrackingAppEventListener::handleToTrash (   $a_obj_id)
staticprotected

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

References updateParentCollections().

Referenced by handleEvent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilTrackingAppEventListener::updateParentCollections (   $a_obj_id)
staticprotected

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

References $query, ilObject\_lookupType(), and ilLPStatusWrapper\_refreshStatus().

Referenced by handleDelete(), and handleToTrash().

{
global $ilDB;
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
// update parent collections?
$set = $ilDB->query("SELECT ut_lp_collections.obj_id obj_id FROM ".
"object_reference JOIN ut_lp_collections ON ".
"(object_reference.obj_id = ".$ilDB->quote($a_obj_id, "integer").
" AND object_reference.ref_id = ut_lp_collections.item_id)");
while ($rec = $ilDB->fetchAssoc($set))
{
if (in_array(ilObject::_lookupType($rec["obj_id"]), array("crs", "grp", "fold")))
{
// remove from parent collection
$query = "DELETE FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($rec["obj_id"], "integer").
" AND item_id = ".$ilDB->quote($a_obj_id, "integer");
$ilDB->manipulate($query);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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