ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilECSEventQueueReader Class Reference

Reads ECS events and stores them in the database. More...

+ Collaboration diagram for ilECSEventQueueReader:

Public Member Functions

 __construct ($a_server_id)
 Constructor. More...
 
 getServer ()
 get server setting More...
 
 getEvents ()
 get all events More...
 
 deleteAll ()
 Delete all events. More...
 
 deleteAllEContentEvents (array $a_types)
 Delete all econtents. More...
 
 refresh ()
 Fetch events from fifo Using fifo public. More...
 
 shift ()
 get and delete the first event entry More...
 
 add ($a_type, $a_id, $a_op)
 add More...
 
 delete ($a_event_id)
 delete private More...
 
 read ()
 Read public. More...
 

Static Public Member Functions

static handleImportReset (ilECSSetting $server)
 Reread all imported econtent. More...
 
static handleExportReset (ilECSSetting $server)
 Handle export reset. More...
 
static deleteServer ($a_server_id)
 Delete by server id ilDB $ilDB. More...
 
static deleteByServerId ($a_server_id)
 

Data Fields

const TYPE_EXPORTED = 'exported'
 
const TYPE_DIRECTORY_TREES = 'directory_trees'
 
const TYPE_CMS_COURSES = 'courses'
 
const TYPE_CMS_COURSE_MEMBERS = 'course_members'
 
const TYPE_REMOTE_COURSE = 'rcrs'
 
const TYPE_REMOTE_CATEGORY = 'rcat'
 
const TYPE_REMOTE_FILE = 'rfil'
 
const TYPE_REMOTE_GLOSSARY = 'rglo'
 
const TYPE_REMOTE_GROUP = 'rgrp'
 
const TYPE_REMOTE_LEARNING_MODULE = 'rlm'
 
const TYPE_REMOTE_WIKI = 'rwik'
 
const TYPE_REMOTE_TEST = 'rtst'
 
const TYPE_COURSE_URLS = 'course_urls'
 
const TYPE_ENROLMENT_STATUS = 'member_status'
 

Protected Member Functions

 deleteAllExportedEvents ()
 Delete all exported events. More...
 

Static Protected Member Functions

static getEventTypeFromObjectType ($a_obj_type)
 Convert object type to event type. More...
 
static getAllEContentTypes ()
 All available content types. More...
 
static getAllResourceIds (ilECSSetting $server, array $a_types, $a_sender_only=false)
 Get all resource ids by resource type. More...
 

Protected Attributes

 $log
 
 $db
 
 $events = array()
 
 $econtent_ids = array()
 

Private Member Functions

 writeEventToDB (ilECSEvent $ev)
 Write event to db. More...
 
 update ($a_type, $a_id, $a_operation)
 update one entry More...
 

Detailed Description

Reads ECS events and stores them in the database.

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

Definition at line 36 of file class.ilECSEventQueueReader.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSEventQueueReader::__construct (   $a_server_id)

Constructor.

public

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

References $ilDB, $ilLog, ilECSSetting\getInstanceByServerId(), read(), and settings().

65  {
66  global $ilLog,$ilDB;
67 
68  include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
69 
70  $this->settings = ilECSSetting::getInstanceByServerId($a_server_id);
71  $this->log = $ilLog;
72  $this->db = $ilDB;
73 
74  $this->read();
75  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
settings()
Definition: settings.php:2
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilECSEventQueueReader::add (   $a_type,
  $a_id,
  $a_op 
)

add

public

Definition at line 550 of file class.ilECSEventQueueReader.php.

References $a_type, $ilDB, $query, $res, and getServer().

551  {
552  global $ilDB;
553 
554  $next_id = $ilDB->nextId('ecs_events');
555  $query = "INSERT INTO ecs_events (event_id,type,id,op,server_id) ".
556  "VALUES (".
557  $ilDB->quote($next_id,'integer').", ".
558  $this->db->quote($a_type,'text').", ".
559  $this->db->quote($a_id,'integer').", ".
560  $this->db->quote($a_op,'text').", ".
561  $ilDB->quote($this->getServer()->getServerId(),'integer').' '.
562  ")";
563  $res = $ilDB->manipulate($query);
564 
565  $new_event['event_id'] = $next_id;
566  $new_event['type'] = $a_type;
567  $new_event['id'] = $a_id;
568  $new_event['op'] = $a_op;
569 
570  $this->events[] = $new_event;
571  $this->econtent_ids[$a_id] = $a_id;
572  return true;
573  }
$a_type
Definition: workflow.php:93
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilECSEventQueueReader::delete (   $a_event_id)

delete private

Parameters
intevent id

Definition at line 599 of file class.ilECSEventQueueReader.php.

References $ilDB, $query, $res, and getServer().

600  {
601  global $ilDB;
602 
603  $query = "DELETE FROM ecs_events ".
604  "WHERE event_id = ".$this->db->quote($a_event_id,'integer')." ".
605  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
606  $res = $ilDB->manipulate($query);
607  unset($this->econtent_ids[$a_event_id]);
608  return true;
609  }
global $ilDB
+ Here is the call graph for this function:

◆ deleteAll()

ilECSEventQueueReader::deleteAll ( )

Delete all events.

public

Definition at line 296 of file class.ilECSEventQueueReader.php.

References $ilDB, $query, $res, and getServer().

297  {
298  global $ilDB;
299 
300  $query = "DELETE FROM ecs_events ".
301  'WHERE server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
302  $res = $ilDB->manipulate($query);
303  return true;
304  }
global $ilDB
+ Here is the call graph for this function:

◆ deleteAllEContentEvents()

ilECSEventQueueReader::deleteAllEContentEvents ( array  $a_types)

Delete all econtents.

public

Parameters
array$a_types

Definition at line 312 of file class.ilECSEventQueueReader.php.

References $ilDB, $query, $res, and getServer().

Referenced by handleImportReset().

313  {
314  global $ilDB;
315 
316  $query = "DELETE FROM ecs_events ".
317  "WHERE ".$this->db->in("type", $a_types, "", "text").' '.
318  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
319  $res = $ilDB->manipulate($query);
320  return true;
321  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAllExportedEvents()

ilECSEventQueueReader::deleteAllExportedEvents ( )
protected

Delete all exported events.

public

Definition at line 328 of file class.ilECSEventQueueReader.php.

References $ilDB, $query, $res, and getServer().

Referenced by handleExportReset().

329  {
330  global $ilDB;
331 
332  $query = "DELETE FROM ecs_events ".
333  "WHERE type = ".$this->db->quote(self::TYPE_EXPORTED,'text').' '.
334  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
335  $res = $ilDB->manipulate($query);
336  return true;
337  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSEventQueueReader::deleteByServerId (   $a_server_id)
static

Definition at line 638 of file class.ilECSEventQueueReader.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

639  {
640  global $ilDB;
641 
642  $query = 'DELETE FROM ecs_events'.
643  ' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
644  $ilDB->manipulate($query);
645  return true;
646  }
global $ilDB
+ Here is the caller graph for this function:

◆ deleteServer()

static ilECSEventQueueReader::deleteServer (   $a_server_id)
static

Delete by server id ilDB $ilDB.

Parameters
int$a_server_id

Definition at line 389 of file class.ilECSEventQueueReader.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

390  {
391  global $ilDB;
392 
393  $query = 'DELETE FROM ecs_events '.
394  'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
395  $ilDB->manipulate($query);
396  }
global $ilDB
+ Here is the caller graph for this function:

◆ getAllEContentTypes()

static ilECSEventQueueReader::getAllEContentTypes ( )
staticprotected

All available content types.

Returns
array

Definition at line 94 of file class.ilECSEventQueueReader.php.

References array.

95  {
96  return array(self::TYPE_REMOTE_COURSE, self::TYPE_REMOTE_CATEGORY,
97  self::TYPE_REMOTE_FILE, self::TYPE_REMOTE_GLOSSARY, self::TYPE_REMOTE_GROUP,
98  self::TYPE_REMOTE_LEARNING_MODULE, self::TYPE_REMOTE_WIKI, self::TYPE_REMOTE_TEST);
99  }
Create styles array
The data for the language used.

◆ getAllResourceIds()

static ilECSEventQueueReader::getAllResourceIds ( ilECSSetting  $server,
array  $a_types,
  $a_sender_only = false 
)
staticprotected

Get all resource ids by resource type.

Parameters
ilECSSetting$server
array$a_types
bool$a_sender_only
Returns
array type => ids

Definition at line 109 of file class.ilECSEventQueueReader.php.

References array, and ilRemoteObjectBase\getInstanceByEventType().

110  {
111  include_once 'Services/WebServices/ECS/classes/class.ilRemoteObjectBase.php';
112  $list = array();
113  foreach($a_types as $type)
114  {
116  if($robj)
117  {
118  $list[$type] = $robj->getAllResourceIds($server, $a_sender_only);
119  }
120  }
121 
122  return $list;
123  }
static getInstanceByEventType($a_type)
Get instance by ilECSEvent(QueueReader) type.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getEvents()

ilECSEventQueueReader::getEvents ( )

get all events

public

Definition at line 286 of file class.ilECSEventQueueReader.php.

References array.

287  {
288  return $this->events ? $this->events : array();
289  }
Create styles array
The data for the language used.

◆ getEventTypeFromObjectType()

static ilECSEventQueueReader::getEventTypeFromObjectType (   $a_obj_type)
staticprotected

Convert object type to event type.

Parameters
string$a_obj_type
Returns
string

Definition at line 83 of file class.ilECSEventQueueReader.php.

84  {
85  // currently they are the same for all resource types
86  return $a_obj_type;
87  }

◆ getServer()

ilECSEventQueueReader::getServer ( )

get server setting

Returns
ilECSSetting

Definition at line 274 of file class.ilECSEventQueueReader.php.

Referenced by add(), delete(), deleteAll(), deleteAllEContentEvents(), deleteAllExportedEvents(), read(), refresh(), update(), and writeEventToDB().

275  {
276  return $this->settings;
277  }
+ Here is the caller graph for this function:

◆ handleExportReset()

static ilECSEventQueueReader::handleExportReset ( ilECSSetting  $server)
static

Handle export reset.

Delete exported econtent and create it again

Returns
bool throws ilException, ilECSConnectorException

Definition at line 231 of file class.ilECSEventQueueReader.php.

References $GLOBALS, ilECSExport\_deleteEContentIds(), ilECSExport\_getAllEContentIds(), array, deleteAllExportedEvents(), and ilECSSetting\getServerId().

Referenced by ilECSSettingsGUI\readAll().

232  {
233  include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
234 
235  // Delete all export events
236  $queue = new ilECSEventQueueReader($server->getServerId());
237  $queue->deleteAllExportedEvents();
238 
239  // Read all local export info
240  $local_econtent_ids = ilECSExport::_getAllEContentIds($server->getServerId());
241 
242  $types = self::getAllEContentTypes();
243  $list = self::getAllResourceIds($server, $types, true);
244 
245 
246  // merge in one array
247  $all_remote_ids = array();
248  foreach($list as $resource_type => $remote_ids)
249  {
250  $all_remote_ids = array_merge($all_remote_ids,(array) $remote_ids);
251  }
252  $all_remote_ids = array_unique($all_remote_ids);
253 
254  $GLOBALS['ilLog']->write(__METHOD__.': Resources = ' . print_r($all_remote_ids,true));
255  $GLOBALS['ilLog']->write(__METHOD__.': Local = ' . print_r($local_econtent_ids,true));
256  foreach($local_econtent_ids as $local_econtent_id => $local_obj_id)
257  {
258  if(!in_array($local_econtent_id, $all_remote_ids))
259  {
260  // Delete this deprecated info
261  $GLOBALS['ilLog']->write(__METHOD__.': Deleting deprecated econtent id '. $local_econtent_id);
262  ilECSExport::_deleteEContentIds($server->getServerId(),array($local_econtent_id));
263 
264  }
265  }
266  return true;
267  }
static _getAllEContentIds($a_server_id)
get all exported econtent ids per server
getServerId()
Get current server id.
static _deleteEContentIds($a_server_id, $a_ids)
Delete econtent ids for server.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
deleteAllExportedEvents()
Delete all exported events.
Reads ECS events and stores them in the database.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleImportReset()

static ilECSEventQueueReader::handleImportReset ( ilECSSetting  $server)
static

Reread all imported econtent.

Returns
bool throws ilException, ilECSConnectorException

Definition at line 132 of file class.ilECSEventQueueReader.php.

References $GLOBALS, $ilLog, ilObject\_lookupType(), array, ilECSEvent\CREATED, deleteAllEContentEvents(), ilECSEvent\DESTROYED, ilECSImport\getAllImportedRemoteObjects(), ilECSUtils\getPossibleRemoteTypes(), ilECSSetting\getServerId(), and ilECSEvent\UPDATED.

Referenced by ilECSSettingsGUI\readAll().

133  {
134  global $ilLog;
135 
136  include_once('Services/WebServices/ECS/classes/class.ilECSConnector.php');
137  include_once('Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
138 
139  try
140  {
141  include_once('./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
142  include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
143  include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
144 
145  $types = self::getAllEContentTypes();
146 
147  $event_queue = new ilECSEventQueueReader($server->getServerId());
148  $event_queue->deleteAllEContentEvents($types);
149 
150  $list = self::getAllResourceIds($server, $types);
152 
153  $GLOBALS['ilLog']->write(__METHOD__.': Imported = '.print_r($imported,true));
154  $GLOBALS['ilLog']->write(__METHOD__.': List = '.print_r($list,true));
155 
156  foreach($list as $resource_type => $link_ids)
157  {
158  if(!in_array($resource_type, ilECSUtils::getPossibleRemoteTypes()))
159  {
160  $GLOBALS['ilLog']->write(__METHOD__.': Ignoring resource type '. $resource_type);
161  continue;
162  }
163 
164 
165  foreach((array) $link_ids as $link_id)
166  {
167  if(!isset($imported[$link_id]))
168  {
169  // Add create event for not imported econtent
170  $event_queue->add(
171  $resource_type,
172  $link_id,
174  );
175  }
176  else
177  {
178  // Add update event for already existing events
179  $event_queue->add(
180  $resource_type,
181  $link_id,
183  );
184  }
185 
186  if(isset($imported[$link_id]))
187  {
188  unset($imported[$link_id]);
189  }
190  }
191  }
192 
193  if(is_array($imported))
194  {
195  // Delete event for deprecated econtent
196  include_once 'Services/WebServices/ECS/classes/class.ilECSObjectSettings.php';
197  foreach($imported as $econtent_id => $obj_id)
198  {
199  $type = self::getEventTypeFromObjectType(ilObject::_lookupType($obj_id));
200  if($type)
201  {
202  $event_queue->add($type,
203  $econtent_id,
205  );
206  }
207  }
208  }
209  }
210  catch(ilECSConnectorException $e1)
211  {
212  $ilLog->write('Cannot connect to ECS server: '.$e1->getMessage());
213  throw $e1;
214  }
215  catch(ilException $e2)
216  {
217  $ilLog->write('Update failed: '.$e2->getMessage());
218  throw $e2;
219  }
220  return true;
221  }
static getAllImportedRemoteObjects($a_server_id)
get all imported links
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
Base class for ILIAS Exception handling.
getServerId()
Get current server id.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
deleteAllEContentEvents(array $a_types)
Delete all econtents.
Reads ECS events and stores them in the database.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilECSEventQueueReader::read ( )

Read public.

Definition at line 615 of file class.ilECSEventQueueReader.php.

References $counter, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getServer().

Referenced by __construct().

616  {
617  global $ilDB;
618 
619  $query = "SELECT * FROM ecs_events ".
620  'WHERE server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer').' '.
621  'ORDER BY event_id';
622 
623  $res = $this->db->query($query);
624  $counter = 0;
625  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
626  {
627  $this->events[$counter]['event_id'] = $row->event_id;
628  $this->events[$counter]['type'] = $row->type;
629  $this->events[$counter]['id'] = $row->id;
630  $this->events[$counter]['op'] = $row->op;
631 
632  $this->econtent_ids[$row->event_id] = $row->event_id;
633  ++$counter;
634  }
635  return true;
636  }
$counter
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refresh()

ilECSEventQueueReader::refresh ( )

Fetch events from fifo Using fifo public.

Exceptions
ilECSConnectorException

Definition at line 345 of file class.ilECSEventQueueReader.php.

References $GLOBALS, $res, $result, getServer(), and writeEventToDB().

346  {
347  try {
348  include_once('Services/WebServices/ECS/classes/class.ilECSConnector.php');
349  include_once('Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
350 
351  $connector = new ilECSConnector($this->getServer());
352  while(true)
353  {
354  $res = $connector->readEventFifo(false);
355 
356  if(!count($res->getResult()))
357  {
358  return true;
359  }
360 
361  foreach($res->getResult() as $result)
362  {
363  include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
364  $event = new ilECSEvent($result);
365 
366  $GLOBALS['ilLog']->write(__METHOD__.' ---------------------------- Handling new event ');
367  $GLOBALS['ilLog']->write(__METHOD__.print_r($event,true));
368  $GLOBALS['ilLog']->write(__METHOD__.' ---------------------------- Done! ');
369 
370  // Fill command queue
371  $this->writeEventToDB($event);
372  }
373  // Delete from fifo
374  $connector->readEventFifo(true);
375  }
376 
377  }
378  catch(ilECSConnectorException $e)
379  {
380  $GLOBALS['ilLog']->write(__METHOD__.': Cannot read event fifo. Aborting');
381  }
382  }
$result
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
writeEventToDB(ilECSEvent $ev)
Write event to db.
+ Here is the call graph for this function:

◆ shift()

ilECSEventQueueReader::shift ( )

get and delete the first event entry

public

Returns
array event data or an empty array if the queue is empty

Definition at line 529 of file class.ilECSEventQueueReader.php.

References array.

530  {
531  $event = array_shift($this->events);
532  if($event == null)
533  {
534  return array();
535  }
536  else
537  {
538 
539  #$this->delete($event['event_id']);
540  return $event;
541  }
542  }
Create styles array
The data for the language used.

◆ update()

ilECSEventQueueReader::update (   $a_type,
  $a_id,
  $a_operation 
)
private

update one entry

private

Definition at line 581 of file class.ilECSEventQueueReader.php.

References $a_type, $ilDB, $query, $res, and getServer().

582  {
583  global $ilDB;
584 
585  $query = "UPDATE ecs_events ".
586  "SET op = ".$this->db->quote($a_operation,'text')." ".
587  "WHERE type = ".$this->db->quote($a_type,'text')." ".
588  "AND id = ".$this->db->quote($a_id,'integer')." ".
589  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
590  $res = $ilDB->manipulate($query);
591  }
$a_type
Definition: workflow.php:93
global $ilDB
+ Here is the call graph for this function:

◆ writeEventToDB()

ilECSEventQueueReader::writeEventToDB ( ilECSEvent  $ev)
private

Write event to db.

Definition at line 401 of file class.ilECSEventQueueReader.php.

References $ilDB, $query, $res, $row, ilECSEvent\CREATED, ilECSEvent\DESTROYED, ilDBConstants\FETCHMODE_OBJECT, ilECSEvent\getRessourceId(), ilECSEvent\getRessourceType(), getServer(), ilECSEvent\getStatus(), and ilECSEvent\UPDATED.

Referenced by refresh().

402  {
403  global $ilDB;
404 
405  // this should probably be moved elsewhere
406  switch($ev->getRessourceType())
407  {
408  case 'directory_trees':
409  $type = self::TYPE_DIRECTORY_TREES;
410  break;
411 
412  case 'course_members':
413  $type = self::TYPE_CMS_COURSE_MEMBERS;
414  break;
415 
416  case 'courses':
417  $type = self::TYPE_CMS_COURSES;
418  break;
419 
420  case 'courselinks':
421  $type = self::TYPE_REMOTE_COURSE;
422  break;
423 
424  case 'categories':
425  $type = self::TYPE_REMOTE_CATEGORY;
426  break;
427 
428  case 'files':
429  $type = self::TYPE_REMOTE_FILE;
430  break;
431 
432  case 'glossaries':
433  $type = self::TYPE_REMOTE_GLOSSARY;
434  break;
435 
436  case 'groups':
437  $type = self::TYPE_REMOTE_GROUP;
438  break;
439 
440  case 'learningmodules':
441  $type = self::TYPE_REMOTE_LEARNING_MODULE;
442  break;
443 
444  case 'wikis':
445  $type = self::TYPE_REMOTE_WIKI;
446  break;
447 
448  case 'tests':
449  $type = self::TYPE_REMOTE_TEST;
450  break;
451 
452  case 'course_urls':
453  $type = self::TYPE_COURSE_URLS;
454  break;
455 
456  case 'member_status':
457  $type = self::TYPE_ENROLMENT_STATUS;
458  break;
459 
460  default:
461  // write custom event type
462  $type = $ev->getRessourceType();
463  break;
464  }
465 
466  $query = "SELECT * FROM ecs_events ".
467  "WHERE type = ".$ilDB->quote($type,'integer')." ".
468  "AND id = ".$ilDB->quote($ev->getRessourceId(),'integer')." ".
469  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
470  $res = $ilDB->query($query);
471 
472  $event_id = 0;
473  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
474  {
475  $event_id = $row->event_id;
476  }
477 
478  if(!$event_id)
479  {
480  // No previous entry exists => perform insert
481  $query = "INSERT ecs_events (event_id,type,id,op,server_id) ".
482  "VALUES( ".
483  $ilDB->quote($ilDB->nextId('ecs_events'),'integer').','.
484  $ilDB->quote($type,'text').', '.
485  $ilDB->quote($ev->getRessourceId(),'integer').', '.
486  $ilDB->quote($ev->getStatus(),'text').', '.
487  $ilDB->quote($this->getServer()->getServerId(),'integer').' '.
488  ')';
489  $ilDB->manipulate($query);
490  return true;
491  }
492  // Do update
493  $do_update = false;
494  switch($ev->getStatus())
495  {
496  case ilECSEvent::CREATED:
497  // Do update, although impossible
498  $do_update = true;
499  break;
500 
502  $do_update = true;
503  break;
504 
505  case ilECSEvent::UPDATED:
506  // Do nothing. Old status is ok.
507  break;
508  }
509 
510  if(!$do_update)
511  {
512  return true;
513  }
514  $query = "UPDATE ecs_events ".
515  "SET op = ".$ilDB->quote($ev->getStatus(),'text')." ".
516  "WHERE event_id = ".$ilDB->quote($event_id,'integer').' '.
517  'AND type = '.$ilDB->quote($type).' '.
518  'AND server_id = '.$ilDB->quote($this->getServer()->getServerId(),'integer');
519  $ilDB->manipulate($query);
520  return true;
521  }
getStatus()
get title
getRessourceType()
Get ressource type.
getRessourceId()
Get ressource id.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilECSEventQueueReader::$db
protected

Definition at line 54 of file class.ilECSEventQueueReader.php.

◆ $econtent_ids

ilECSEventQueueReader::$econtent_ids = array()
protected

Definition at line 57 of file class.ilECSEventQueueReader.php.

◆ $events

ilECSEventQueueReader::$events = array()
protected

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

◆ $log

ilECSEventQueueReader::$log
protected

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

◆ TYPE_CMS_COURSE_MEMBERS

const ilECSEventQueueReader::TYPE_CMS_COURSE_MEMBERS = 'course_members'

Definition at line 41 of file class.ilECSEventQueueReader.php.

Referenced by ilECSTaskScheduler\handleEvents().

◆ TYPE_CMS_COURSES

const ilECSEventQueueReader::TYPE_CMS_COURSES = 'courses'

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

Referenced by ilECSTaskScheduler\handleEvents().

◆ TYPE_COURSE_URLS

const ilECSEventQueueReader::TYPE_COURSE_URLS = 'course_urls'

Definition at line 50 of file class.ilECSEventQueueReader.php.

Referenced by ilECSTaskScheduler\handleEvents().

◆ TYPE_DIRECTORY_TREES

const ilECSEventQueueReader::TYPE_DIRECTORY_TREES = 'directory_trees'

◆ TYPE_ENROLMENT_STATUS

const ilECSEventQueueReader::TYPE_ENROLMENT_STATUS = 'member_status'

Definition at line 51 of file class.ilECSEventQueueReader.php.

Referenced by ilECSTaskScheduler\handleEvents().

◆ TYPE_EXPORTED

const ilECSEventQueueReader::TYPE_EXPORTED = 'exported'

Definition at line 38 of file class.ilECSEventQueueReader.php.

◆ TYPE_REMOTE_CATEGORY

const ilECSEventQueueReader::TYPE_REMOTE_CATEGORY = 'rcat'

◆ TYPE_REMOTE_COURSE

const ilECSEventQueueReader::TYPE_REMOTE_COURSE = 'rcrs'

◆ TYPE_REMOTE_FILE

const ilECSEventQueueReader::TYPE_REMOTE_FILE = 'rfil'

◆ TYPE_REMOTE_GLOSSARY

const ilECSEventQueueReader::TYPE_REMOTE_GLOSSARY = 'rglo'

◆ TYPE_REMOTE_GROUP

const ilECSEventQueueReader::TYPE_REMOTE_GROUP = 'rgrp'

◆ TYPE_REMOTE_LEARNING_MODULE

const ilECSEventQueueReader::TYPE_REMOTE_LEARNING_MODULE = 'rlm'

◆ TYPE_REMOTE_TEST

const ilECSEventQueueReader::TYPE_REMOTE_TEST = 'rtst'

◆ TYPE_REMOTE_WIKI

const ilECSEventQueueReader::TYPE_REMOTE_WIKI = 'rwik'

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