3 declare(strict_types=1);
22 $this->appointment_id = $a_appointment_id;
24 $this->db = $DIC->database();
33 $query =
"DELETE FROM cal_registrations " .
34 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer');
43 $query =
"DELETE FROM cal_registrations " .
44 "WHERE cal_id = " .
$ilDB->quote($a_cal_id,
'integer');
56 foreach ($this->registered as $reg_data) {
61 $users[] = (
int) $reg_data[
'usr_id'];
69 foreach ($this->registered as $reg_data) {
70 if ($reg_data[
'usr_id'] == $a_usr_id) {
83 $query =
"INSERT INTO cal_registrations (cal_id,usr_id,dstart,dend) " .
86 $this->db->quote($a_usr_id,
'integer') .
", " .
87 $this->db->quote($start->get(
IL_CAL_UNIX),
'integer') .
", " .
88 $this->db->quote($end->get(
IL_CAL_UNIX),
'integer') .
90 $this->db->manipulate(
$query);
91 $this->registered[] = [
92 'usr_id' => $a_usr_id,
103 $query =
"DELETE FROM cal_registrations " .
104 "WHERE cal_id = " . $this->db->quote($this->
getAppointmentId(),
'integer') .
' ' .
105 "AND usr_id = " . $this->db->quote($a_usr_id,
'integer') .
' ' .
106 "AND dstart = " . $this->db->quote($start->
get(
IL_CAL_UNIX),
'integer') .
' ' .
107 "AND dend = " . $this->db->quote($end->
get(
IL_CAL_UNIX),
'integer');
114 protected function read(): void
120 $query =
"SELECT * FROM cal_registrations WHERE cal_id = " . $this->db->quote(
126 $this->registered[] = array(
127 'usr_id' => (
int) $row->usr_id,
128 'dstart' => (
int) $row->dstart,
129 'dend' => (
int) $row->dend
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
unregister(int $a_usr_id, ilDateTime $start, ilDateTime $end)
unregister one user
static deleteByUser(int $a_usr_id)
registration for calendar appointments
__construct(int $a_appointment_id)
isRegistered($a_usr_id, ilDateTime $start, ilDateTime $end)
getRegisteredUsers(\ilDateTime $start, \ilDateTime $end)
static deleteByAppointment(int $a_cal_id)