/**
  * Import ical in calendar
  * @param ilCalendarCategory $cat 
  */
 protected function importIcal(ilCalendarCategory $cat)
 {
     // Delete old appointments
     include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
     foreach (ilCalendarCategoryAssignments::_getAssignedAppointments(array($cat->getCategoryID())) as $app_id) {
         include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
         ilCalendarEntry::_delete($app_id);
     }
     ilCalendarCategoryAssignments::_deleteByCategoryId($cat->getCategoryID());
     // Import new appointments
     include_once './Services/Calendar/classes/iCal/class.ilICalParser.php';
     $parser = new ilICalParser($this->ical, ilICalParser::INPUT_STRING);
     $parser->setCategoryId($cat->getCategoryID());
     $parser->parse();
 }
 /**
  * delete
  *
  * @access public
  * @return
  */
 public function delete()
 {
     global $ilDB;
     $query = "DELETE FROM cal_categories " . "WHERE cat_id = " . $this->db->quote($this->cat_id, 'integer') . " ";
     $res = $ilDB->manipulate($query);
     include_once './Services/Calendar/classes/class.ilCalendarHidden.php';
     ilCalendarHidden::_deleteCategories($this->cat_id);
     include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
     foreach (ilCalendarCategoryAssignments::_getAssignedAppointments(array($this->cat_id)) as $app_id) {
         include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
         ilCalendarEntry::_delete($app_id);
     }
     ilCalendarCategoryAssignments::_deleteByCategoryId($this->cat_id);
 }