ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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 (string $a_component, string $a_event, array $a_parameter)
 

Static Protected Member Functions

static storeElement (string $a_command, array $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

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

Member Function Documentation

◆ handleEvent()

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

Implements ilAppEventListener.

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

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

33  : void
34  {
35  if (!isset($a_parameter['obj_id'])) {
36  return;
37  }
38 
39 
40  // only for files in the moment
41  if (!isset($a_parameter['obj_type'])) {
42  $type = ilObject::_lookupType($a_parameter['obj_id']);
43  } else {
44  $type = $a_parameter['obj_type'];
45  }
46 
47  switch ($a_component) {
48  case 'components/ILIAS/Search':
49  if ($a_event === 'contentChanged') {
51  }
52  break;
53 
54  case 'components/ILIAS/Help':
55  case 'components/ILIAS/ILIASObject':
56 
57  switch ($a_event) {
58  case 'undelete':
59  case 'update':
61  break;
62 
63  case 'create':
65  break;
66 
67  case 'delete':
68  case 'toTrash':
70  break;
71 
72  default:
73  return;
74  }
75  ilSearchAppEventListener::storeElement($command, $a_parameter);
76  }
77  }
static storeElement(string $a_command, array $a_params)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ storeElement()

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

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

References ilObject\_lookupType(), ilSearchCommandQueue\factory(), and ilLoggerFactory\getLogger().

Referenced by handleEvent().

79  : bool
80  {
81  if (!$a_command) {
82  return false;
83  }
84 
85  if (!isset($a_params['obj_id']) or !$a_params['obj_id']) {
86  return false;
87  }
88 
89  if (!isset($a_params['obj_type']) or !$a_params['obj_type']) {
90  $a_params['obj_type'] = ilObject::_lookupType($a_params['obj_id']);
91  }
92  ilLoggerFactory::getLogger('src')->debug('Handling new command: ' . $a_command . ' for type ' . $a_params['obj_type']);
93 
94  $element = new ilSearchCommandQueueElement();
95  $element->setObjId($a_params['obj_id']);
96  $element->setObjType($a_params['obj_type']);
97  $element->setCommand($a_command);
98 
99  ilSearchCommandQueue::factory()->store($element);
100  return true;
101  }
static getLogger(string $a_component_id)
Get component logger.
Represents an entry for the search command queue.
static factory()
get singleton instance
static _lookupType(int $id, bool $reference=false)
+ 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: