/**
  * Handle events like create, update, delete
  *
  * @access public
  * @param	string	$a_component	component, e.g. "Modules/Forum" or "Services/User"
  * @param	string	$a_event		event e.g. "createUser", "updateUser", "deleteUser", ...
  * @param	array	$a_parameter	parameter array (assoc), array("name" => ..., "phone_office" => ...)	 * 
  * @static
  */
 public static function handleEvent($a_component, $a_event, $a_parameter)
 {
     global $ilLog, $ilUser;
     switch ($a_component) {
         case 'Modules/Session':
         case 'Modules/Group':
         case 'Modules/Course':
             switch ($a_event) {
                 case 'create':
                     $ilLog->write(__METHOD__ . ': Handling create event');
                     self::createCategory($a_parameter['object']);
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     break;
                 case 'update':
                     $ilLog->write(__METHOD__ . ': Handling update event');
                     self::updateCategory($a_parameter['object']);
                     self::deleteAppointments($a_parameter['obj_id']);
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     break;
                 case 'delete':
                     $ilLog->write(__METHOD__ . ': Handling delete event');
                     self::deleteCategory($a_parameter['obj_id']);
                     break;
             }
             include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
             ilCalendarCategories::deletePDItemsCache($ilUser->getId());
             ilCalendarCategories::deleteRepositoryCache($ilUser->getId());
             break;
         case 'Services/Booking':
             switch ($a_event) {
                 case 'create':
                     break;
                 case 'update':
                     break;
                 case 'delete':
                     break;
             }
     }
 }
 /**
  * Handle events like create, update, delete
  *
  * @access public
  * @param	string	$a_component	component, e.g. "Modules/Forum" or "Services/User"
  * @param	string	$a_event		event e.g. "createUser", "updateUser", "deleteUser", ...
  * @param	array	$a_parameter	parameter array (assoc), array("name" => ..., "phone_office" => ...)	 * 
  * @static
  */
 public static function handleEvent($a_component, $a_event, $a_parameter)
 {
     global $ilLog, $ilUser;
     $delete_cache = false;
     switch ($a_component) {
         case 'Modules/Session':
         case 'Modules/Group':
         case 'Modules/Course':
             switch ($a_event) {
                 case 'create':
                     $ilLog->write(__METHOD__ . ': Handling create event');
                     self::createCategory($a_parameter['object']);
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     $delete_cache = true;
                     break;
                 case 'update':
                     $ilLog->write(__METHOD__ . ': Handling update event');
                     self::updateCategory($a_parameter['object']);
                     self::deleteAppointments($a_parameter['obj_id']);
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     $delete_cache = true;
                     break;
                 case 'delete':
                     $ilLog->write(__METHOD__ . ': Handling delete event');
                     self::deleteCategory($a_parameter['obj_id']);
                     $delete_cache = true;
                     break;
             }
             break;
         case 'Services/Booking':
             switch ($a_event) {
                 case 'create':
                     break;
                 case 'update':
                     break;
                 case 'delete':
                     break;
             }
             break;
         case 'Modules/Exercise':
             switch ($a_event) {
                 case 'createAssignment':
                     $ilLog->write(__METHOD__ . ': Handling create event (exercise assignment)');
                     self::createCategory($a_parameter['object'], true);
                     // exercise category could already exist
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     $delete_cache = true;
                     break;
                 case 'updateAssignment':
                     $ilLog->write(__METHOD__ . ': Handling update event (exercise assignment)');
                     self::createCategory($a_parameter['object'], true);
                     // different life-cycle than ilObject
                     self::deleteAppointments($a_parameter['obj_id'], $a_parameter['context_ids']);
                     self::createAppointments($a_parameter['object'], $a_parameter['appointments']);
                     $delete_cache = true;
                     break;
                 case 'deleteAssignment':
                     $ilLog->write(__METHOD__ . ': Handling delete event (exercise assignment)');
                     self::deleteAppointments($a_parameter['obj_id'], $a_parameter['context_ids']);
                     $delete_cache = true;
                     break;
                 case 'delete':
                     $ilLog->write(__METHOD__ . ': Handling delete event');
                     self::deleteCategory($a_parameter['obj_id']);
                     $delete_cache = true;
                     break;
             }
             break;
     }
     if ($delete_cache) {
         include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
         ilCalendarCategories::deletePDItemsCache($ilUser->getId());
         ilCalendarCategories::deleteRepositoryCache($ilUser->getId());
     }
 }