public function insertBookingAppointment($a_insertedId, $a_booking_values, $a_from = NULL, $a_to = NULL)
 {
     //create appointment first
     if ($a_from == NULL || $a_to == NULL) {
         $a_from = $a_booking_values['from']['date'] . " " . $a_booking_values['from']['time'];
         $a_to = $a_booking_values['to']['date'] . " " . $a_booking_values['to']['time'];
     }
     $time_start = new ilDateTime($a_from, 1);
     $time_end = new ilDateTime($a_to, 1);
     $title = $a_booking_values['subject'];
     $room_name = $this->ilRoomSharingDatabase->getRoomName($a_booking_values['room']);
     $cal_cat_id = $a_booking_values['cal_id'];
     //use original ilCalendarEntry and let ILIAS do the work
     $app = new ilCalendarEntry();
     $app->setStart($time_start);
     $app->setEnd($time_end);
     $app->setFullday(false);
     $app->setTitle($title);
     $app->setDescription($a_booking_values['comment']);
     $app->setAutoGenerated(true);
     $app->enableNotification(false);
     $app->setLocation($room_name);
     $app->validate();
     $app->save();
     $ass = new ilCalendarCategoryAssignments($app->getEntryId());
     $ass->addAssignment($cal_cat_id);
     //update bookings-table afterwards
     $this->ilDB->manipulate('UPDATE ' . dbc::BOOKINGS_TABLE . ' SET calendar_entry_id = ' . $this->ilDB->quote($app->getEntryId(), 'integer') . ' WHERE id = ' . $this->ilDB->quote($a_insertedId, 'integer') . ' AND pool_id =' . $this->ilDB->quote($this->pool_id, 'integer'));
 }