ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSearchAppEventListener Class Reference

Update search command queue from Services/Object events. More...

+ Inheritance diagram for ilSearchAppEventListener:
+ Collaboration diagram for ilSearchAppEventListener:

Static Public Member Functions

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

Static Protected Member Functions

static storeElement ($a_command, $a_params)
 

Detailed Description

Update search command queue from Services/Object events.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 37 of file class.ilSearchAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilSearchAppEventListener::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 47 of file class.ilSearchAppEventListener.php.

References ilObject\_lookupType(), ilSearchCommandQueueElement\CREATE, ilSearchCommandQueueElement\DELETE, ilSearchCommandQueueElement\RESET, and storeElement().

48  {
49  // only for files in the moment
50  if(!isset($a_params['obj_type']))
51  {
52  $type = ilObject::_lookupType($a_params['obj_id']);
53  }
54  else
55  {
56  $type = $a_params['obj_type'];
57  }
58 
59  if($type != 'file' and
60  $type != 'htlm')
61  {
62  return;
63  }
64 
65  switch($a_component)
66  {
67  case 'Services/Object':
68 
69  switch($a_event)
70  {
71  case 'update':
73  break;
74 
75  case 'create':
77  break;
78 
79  case 'toTrash':
81  break;
82 
83  case 'delete':
85  break;
86 
87  case 'undelete':
89  break;
90 
91  default:
92  return true;
93  }
94 
95  ilSearchAppEventListener::storeElement($command,$a_params);
96  return true;
97  }
98  }
static storeElement($a_command, $a_params)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ storeElement()

static ilSearchAppEventListener::storeElement (   $a_command,
  $a_params 
)
staticprotected

Definition at line 100 of file class.ilSearchAppEventListener.php.

References $ilLog, ilObject\_lookupType(), and ilSearchCommandQueue\factory().

Referenced by handleEvent().

101  {
102  global $ilLog;
103 
104  if(!$a_command)
105  {
106  return false;
107  }
108 
109  if(!isset($a_params['obj_id']) or !$a_params['obj_id'])
110  {
111  return false;
112  }
113 
114  if(!isset($a_params['obj_type']) or !$a_params['obj_type'])
115  {
116  $a_params['obj_type'] = ilObject::_lookupType($a_params['obj_id']);
117  }
118 
119  $ilLog->write(__METHOD__.': Handling new command: '.$a_command.' for type '.$a_params['obj_type']);
120 
121  $element = new ilSearchCommandQueueElement();
122  $element->setObjId($a_params['obj_id']);
123  $element->setObjType($a_params['obj_type']);
124  $element->setCommand($a_command);
125 
126  ilSearchCommandQueue::factory()->store($element);
127  return true;
128  }
Represents an entry for the search command queue.
static _lookupType($a_id, $a_reference=false)
lookup object type
factory()
get singleton instance
+ 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: