/**
  * Delete automatic generated appointments
  * 
  * @access public
  * @param int obj_id
  * @static
  */
 public static function deleteAppointments($a_obj_id)
 {
     include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
     include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
     foreach (ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id) {
         ilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);
         ilCalendarEntry::_delete($app_id);
     }
 }
 /**
  * Delete automatic generated appointments
  * 
  * @access public
  * @param int obj_id
  * @param array context ids
  * @static
  */
 public static function deleteAppointments($a_obj_id, array $a_context_ids = null)
 {
     include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
     include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
     foreach (ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id) {
         // delete only selected entries
         if (is_array($a_context_ids)) {
             $entry = new ilCalendarEntry($app_id);
             if (!in_array($entry->getContextId(), $a_context_ids)) {
                 continue;
             }
         }
         ilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);
         ilCalendarEntry::_delete($app_id);
     }
 }