ILIAS  release_8 Revision v8.24
class.ilBookingEntry.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
28{
29 protected ilDBInterface $db;
30 protected ilObjUser $user;
31
32 private int $id = 0;
33 private int $obj_id = 0;
34
35 private int $deadline = 0;
36 private int $num_bookings = 1;
37 private ?array $target_obj_ids = [];
38 private int $booking_group = 0;
39
43 public function __construct(int $a_booking_id = 0)
44 {
45 global $DIC;
46
47 $this->db = $DIC->database();
48 $this->user = $DIC->user();
49 $this->setId($a_booking_id);
50 if ($this->getId()) {
51 $this->read();
52 }
53 }
54
58 public static function resetGroup(int $a_group_id): bool
59 {
60 global $DIC;
61
62 $ilDB = $DIC->database();
63
64 $query = 'UPDATE booking_entry SET booking_group = ' . $ilDB->quote(0, 'integer') . ' ' .
65 'WHERE booking_group = ' . $ilDB->quote($a_group_id, 'integer');
66 $ilDB->manipulate($query);
67 return true;
68 }
69
77 public static function lookupBookingsOfUser(array $a_app_ids, int $a_usr_id, ?ilDateTime $start = null): array
78 {
79 global $DIC;
80
81 $ilDB = $DIC->database();
82 $query = 'SELECT entry_id FROM booking_user ' .
83 'WHERE ' . $ilDB->in('entry_id', $a_app_ids, false, 'integer') . ' ' .
84 'AND user_id = ' . $ilDB->quote($a_usr_id, 'integer');
85
86 $res = $ilDB->query($query);
87
88 $booked_entries = array();
89 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
90 $booked_entries[] = (int) $row->entry_id;
91 }
92 return $booked_entries;
93 }
94
95 protected function setId(int $a_id): void
96 {
97 $this->id = $a_id;
98 }
99
100 public function getId(): int
101 {
102 return $this->id;
103 }
104
105 public function setBookingGroup(int $a_id): void
106 {
107 $this->booking_group = $a_id;
108 }
109
110 public function getBookingGroup(): int
111 {
113 }
114
115 public function setObjId(int $a_id): void
116 {
117 $this->obj_id = $a_id;
118 }
119
120 public function getObjId(): int
121 {
122 return $this->obj_id;
123 }
124
125 public function setDeadlineHours(int $a_hours): void
126 {
127 $this->deadline = $a_hours;
128 }
129
130 public function getDeadlineHours(): int
131 {
132 return $this->deadline;
133 }
134
135 public function setNumberOfBookings(int $a_num): void
136 {
137 $this->num_bookings = $a_num;
138 }
139
140 public function getNumberOfBookings(): int
141 {
142 return $this->num_bookings;
143 }
144
148 public function setTargetObjIds(?array $a_obj_id): void
149 {
150 $this->target_obj_ids = $a_obj_id;
151 }
152
156 public function getTargetObjIds(): ?array
157 {
159 }
160
164 public function isTargetObjectVisible(int $a_ref_id): bool
165 {
166 // no course/group filter
167 if (!$this->getTargetObjIds()) {
168 return true;
169 }
170
171 $obj_id = ilObject::_lookupObjId($a_ref_id);
172 return in_array($obj_id, $this->getTargetObjIds());
173 }
174
175 public function save(): void
176 {
177 $this->setId($this->db->nextId('booking_entry'));
178 $query = 'INSERT INTO booking_entry (booking_id,obj_id,deadline,num_bookings,booking_group) ' .
179 "VALUES ( " .
180 $this->db->quote($this->getId(), 'integer') . ', ' .
181 $this->db->quote($this->getObjId(), 'integer') . ', ' .
182 $this->db->quote($this->getDeadlineHours(), 'integer') . ', ' .
183 $this->db->quote($this->getNumberOfBookings(), 'integer') . ',' .
184 $this->db->quote($this->getBookingGroup(), 'integer') . ' ' .
185 ") ";
186 $this->db->manipulate($query);
187
188 foreach ((array) $this->target_obj_ids as $obj_id) {
189 $query = 'INSERT INTO booking_obj_assignment (booking_id, target_obj_id) ' .
190 'VALUES( ' .
191 $this->db->quote($this->getId(), 'integer') . ', ' .
192 $this->db->quote($obj_id, 'integer') . ' ' .
193 ')';
194 $this->db->manipulate($query);
195 }
196 }
197
198 public function update(): void
199 {
200 if (!$this->getId()) {
201 return;
202 }
203
204 $query = "UPDATE booking_entry SET " .
205 " obj_id = " . $this->db->quote($this->getObjId(), 'integer') . ", " .
206 " deadline = " . $this->db->quote($this->getDeadlineHours(), 'integer') . ", " .
207 " num_bookings = " . $this->db->quote($this->getNumberOfBookings(), 'integer') . ', ' .
208 'booking_group = ' . $this->db->quote($this->getBookingGroup(), 'integer') . ' ' .
209 'WHERE booking_id = ' . $this->db->quote($this->getId(), 'integer');
210 $this->db->manipulate($query);
211
212 // obj assignments
213 $query = 'DELETE FROM booking_obj_assignment ' .
214 'WHERE booking_id = ' . $this->db->quote($this->getId(), 'integer');
215 $this->db->manipulate($query);
216
217 foreach ((array) $this->target_obj_ids as $obj_id) {
218 $query = 'INSERT INTO booking_obj_assignment (booking_id, target_obj_id) ' .
219 'VALUES( ' .
220 $this->db->quote($this->getId(), 'integer') . ', ' .
221 $this->db->quote($obj_id, 'integer') . ' ' .
222 ')';
223 $this->db->manipulate($query);
224 }
225 }
226
227 public function delete(): void
228 {
229 $query = "DELETE FROM booking_entry " .
230 "WHERE booking_id = " . $this->db->quote($this->getId(), 'integer');
231 $this->db->manipulate($query);
232 $query = 'DELETE FROM booking_obj_assignment ' .
233 'WHERE booking_id = ' . $this->db->quote($this->getId(), 'integer');
234 $this->db->manipulate($query);
235 }
236
237 protected function read(): void
238 {
239 if (!$this->getId()) {
240 return;
241 }
242
243 $query = "SELECT * FROM booking_entry " .
244 "WHERE booking_id = " . $this->db->quote($this->getId(), 'integer');
245 $res = $this->db->query($query);
246 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
247 $this->setObjId((int) $row['obj_id']);
248 $this->setDeadlineHours((int) $row['deadline']);
249 $this->setNumberOfBookings((int) $row['num_bookings']);
250 $this->setBookingGroup((int) $row['booking_group']);
251 }
252
253 $query = 'SELECT * FROM booking_obj_assignment ' .
254 'WHERE booking_id = ' . $this->db->quote($this->getId(), 'integer');
255 $res = $this->db->query($query);
256 $this->target_obj_ids = array();
257 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
258 $this->target_obj_ids[] = (int) $row->target_obj_id;
259 }
260 }
261
267 public function isOwner(?int $a_user_id = null): bool
268 {
269 if (!$a_user_id) {
270 $a_user_id = $this->user->getId();
271 }
272 if ($this->getObjId() == $a_user_id) {
273 return true;
274 }
275 return false;
276 }
277
281 public static function removeObsoleteEntries(): void
282 {
283 global $DIC;
284
285 $ilDB = $DIC->database();
286 $set = $ilDB->query('SELECT DISTINCT(context_id) FROM cal_entries e' .
287 ' JOIN cal_cat_assignments a ON (e.cal_id = a.cal_id)' .
288 ' JOIN cal_categories c ON (a.cat_id = c.cat_id) WHERE c.type = ' . $ilDB->quote(
290 'integer'
291 ));
292
293 $used = array();
294 while ($row = $ilDB->fetchAssoc($set)) {
295 $used[] = $row['context_id'];
296 }
297 $ilDB->query($q = 'DELETE FROM booking_entry WHERE ' . $ilDB->in('booking_id', $used, true, 'integer'));
298 $ilDB->query($q = 'DELETE FROM booking_obj_assignment WHERE ' . $ilDB->in(
299 'booking_id',
300 $used,
301 true,
302 'integer'
303 ));
304 }
305
311 public static function getInstanceByCalendarEntryId(int $a_id): ?ilBookingEntry
312 {
313 $cal_entry = new ilCalendarEntry($a_id);
314 $booking_id = $cal_entry->getContextId();
315 if ($booking_id) {
316 return new self($booking_id);
317 }
318 return null;
319 }
320
327 public static function isBookable(array $a_obj_ids, ?int $a_target_obj_id = null): array
328 {
329 global $DIC;
330
331 $ilDB = $DIC->database();
332 if ($a_target_obj_id) {
333 $query = 'SELECT DISTINCT(obj_id) FROM booking_entry be ' .
334 'JOIN booking_obj_assignment bo ON be.booking_id = bo.booking_id ' .
335 'WHERE ' . $ilDB->in('obj_id', $a_obj_ids, false, 'integer') . ' ' .
336 'AND bo.target_obj_id = ' . $ilDB->quote($a_target_obj_id, 'integer');
337 } else {
338 $query = 'SELECT DISTINCT(obj_id) FROM booking_entry be ' .
339 'WHERE ' . $ilDB->in('obj_id', $a_obj_ids, false, 'integer') . ' ';
340 }
341
342 $res = $ilDB->query($query);
343 $all = [];
344 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
345 $all[] = (int) $row->obj_id;
346 }
347 return $all;
348 }
349
358 public static function lookupBookableUsersForObject(array $a_obj_id, array $a_user_ids): array
359 {
360 global $DIC;
361
362 $ilDB = $DIC->database();
363 $query = 'SELECT be.obj_id bobj FROM booking_entry be ' .
364 'JOIN booking_obj_assignment bo ON be.booking_id = bo.booking_id ' .
365 'JOIN cal_entries ce on be.booking_id = ce.context_id ' .
366 'JOIN cal_cat_assignments cca on ce.cal_id = cca.cal_id ' .
367 'JOIN cal_categories cc on cca.cat_id = cc.cat_id ' .
368 'WHERE ' . $ilDB->in('be.obj_id', $a_user_ids, false, 'integer') . ' ' .
369 'AND ' . $ilDB->in('bo.target_obj_id', $a_obj_id, false, 'integer') . ' ' .
370 'AND cc.obj_id = be.obj_id ' .
371 'AND cc.type = ' . $ilDB->quote(ilCalendarCategory::TYPE_CH, 'integer') . ' ';
372
373 $res = $ilDB->query($query);
374
375 $objs = [];
376 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
377 if (!in_array($row->bobj, $objs)) {
378 $objs[] = (int) $row->bobj;
379 }
380 }
381
382 // non filtered booking entries
383 $query = 'SELECT be.obj_id bobj FROM booking_entry be ' .
384 'LEFT JOIN booking_obj_assignment bo ON be.booking_id = bo.booking_id ' .
385 'JOIN cal_entries ce on be.booking_id = ce.context_id ' .
386 'JOIN cal_cat_assignments cca on ce.cal_id = cca.cal_id ' .
387 'JOIN cal_categories cc on cca.cat_id = cc.cat_id ' .
388 'WHERE bo.booking_id IS NULL ' .
389 'AND ' . $ilDB->in('be.obj_id', $a_user_ids, false, 'integer') . ' ' .
390 'AND cc.obj_id = be.obj_id ' .
391 'AND cc.type = ' . $ilDB->quote(ilCalendarCategory::TYPE_CH, 'integer') . ' ';
392
393 $res = $ilDB->query($query);
394 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
395 if (!in_array($row->bobj, $objs)) {
396 $objs[] = (int) $row->bobj;
397 }
398 }
399 return $objs;
400 }
401
405 public static function hasObjectBookingEntries(int $a_obj_id, int $a_usr_id): bool
406 {
407 global $DIC;
408
409 $ilDB = $DIC->database();
410
411 $user_restriction = '';
412 if ($a_usr_id) {
413 $user_restriction = 'AND obj_id = ' . $ilDB->quote($a_usr_id, ilDBConstants::T_INTEGER) . ' ';
414 }
415
416 $query = 'SELECT be.booking_id FROM booking_entry be ' .
417 'JOIN booking_obj_assignment bo ON be.booking_id = bo.booking_id ' .
418 'WHERE bo.target_obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
419 $user_restriction;
420
421 $res = $ilDB->query($query);
422 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
423 return true;
424 }
425 return false;
426 }
427
428 public static function lookupBookingMessage(int $a_entry_id, int $a_usr_id): string
429 {
430 global $DIC;
431
432 $ilDB = $DIC->database();
433
434 $query = 'SELECT * from booking_user ' .
435 'WHERE entry_id = ' . $ilDB->quote($a_entry_id, 'integer') . ' ' .
436 'AND user_id = ' . $ilDB->quote($a_usr_id, 'integer');
437 $res = $ilDB->query($query);
438 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
439 return (string) $row->booking_message;
440 }
441 return '';
442 }
443
447 public static function writeBookingMessage(int $a_entry_id, int $a_usr_id, string $a_message): void
448 {
449 global $DIC;
450
451 $ilDB = $DIC->database();
452 $query = 'UPDATE booking_user SET ' .
453 'booking_message = ' . $ilDB->quote($a_message, 'text') . ' ' .
454 'WHERE entry_id = ' . $ilDB->quote($a_entry_id, 'integer') . ' ' .
455 'AND user_id = ' . $ilDB->quote($a_usr_id, 'integer');
456
457 $ilDB->manipulate($query);
458 }
459
463 public function getCurrentNumberOfBookings(int $a_entry_id): int
464 {
465 $set = $this->db->query('SELECT COUNT(*) AS counter FROM booking_user' .
466 ' WHERE entry_id = ' . $this->db->quote($a_entry_id, 'integer'));
467 $row = $this->db->fetchAssoc($set);
468 if (is_array($row)) {
469 return (int) $row['counter'];
470 }
471 return 0;
472 }
473
479 public function getCurrentBookings(int $a_entry_id): array
480 {
481 $set = $this->db->query('SELECT user_id FROM booking_user' .
482 ' WHERE entry_id = ' . $this->db->quote($a_entry_id, 'integer'));
483 $res = array();
484 while ($row = $this->db->fetchAssoc($set)) {
485 $res[] = (int) $row['user_id'];
486 }
487 return $res;
488 }
489
495 public static function lookupBookingsForAppointment(int $a_app_id): array
496 {
497 global $DIC;
498
499 $ilDB = $DIC->database();
500 $query = 'SELECT user_id FROM booking_user ' .
501 'WHERE entry_id = ' . $ilDB->quote($a_app_id, 'integer');
502 $res = $ilDB->query($query);
503 $users = [];
504 while ($row = $ilDB->fetchObject($res)) {
505 $users[] = (int) $row->user_id;
506 }
507 return $users;
508 }
509
516 public static function lookupBookingsForObject(int $a_obj_id, int $a_usr_id): array
517 {
518 global $DIC;
519
520 $ilDB = $DIC->database();
521 $query = 'SELECT bu.user_id, starta, enda FROM booking_user bu ' .
522 'JOIN cal_entries ca ON entry_id = ca.cal_id ' .
523 'JOIN booking_entry be ON context_id = booking_id ' .
524 'JOIN booking_obj_assignment bo ON be.booking_id = bo.booking_id ' .
525 'WHERE bo.target_obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ' .
526 'AND be.obj_id = ' . $ilDB->quote($a_usr_id, ilDBConstants::T_INTEGER) . ' ' .
527 'ORDER BY starta';
528 $res = $ilDB->query($query);
529
530 $bookings = array();
531 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
532 $dt = new ilDateTime($row->starta, IL_CAL_DATETIME, ilTimeZone::UTC);
533 $dt_end = new ilDateTime($row->enda, IL_CAL_DATETIME, ilTimeZone::UTC);
534 $bookings[(int) $row->user_id][] = [
535 'dt' => $dt->get(IL_CAL_UNIX),
536 'dtend' => $dt_end->get(IL_CAL_UNIX),
537 'owner' => $a_usr_id
538 ];
539 }
540 return $bookings;
541 }
542
547 public static function lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id): array
548 {
549 $bookings = self::lookupBookingsForObject($a_obj_id, $a_usr_id);
550 foreach (ilConsultationHourUtils::lookupManagedUsers($a_usr_id) as $managed_user_id) {
551 foreach (self::lookupBookingsForObject($a_obj_id, $managed_user_id) as $booked_user => $booking) {
552 $fullname = ilObjUser::_lookupFullname($managed_user_id);
553 foreach ($booking as $booking_entry) {
554 $booking_entry['explanation'] = '(' . $fullname . ')';
555 $bookings[$booked_user][] = $booking_entry;
556 }
557 }
558 }
559 return $bookings;
560 }
561
565 public function hasBooked(int $a_entry_id, ?int $a_user_id = null): bool
566 {
567 if (!$a_user_id) {
568 $a_user_id = $this->user->getId();
569 }
570
571 $query = 'SELECT COUNT(*) AS counter FROM booking_user' .
572 ' WHERE entry_id = ' . $this->db->quote($a_entry_id, 'integer') .
573 ' AND user_id = ' . $this->db->quote($a_user_id, 'integer');
574 $set = $this->db->query($query);
575 $row = $this->db->fetchAssoc($set);
576 if (is_array($row)) {
577 return (bool) $row['counter'];
578 }
579 return false;
580 }
581
585 public function isBookedOut(int $a_entry_id, bool $a_check_current_user = false): bool
586 {
587 if ($this->getNumberOfBookings() == $this->getCurrentNumberOfBookings($a_entry_id)) {
588 // check against current user
589 if ($a_check_current_user) {
590 if ($this->hasBooked($a_entry_id)) {
591 return false;
592 }
593 if ($this->user->getId() == $this->getObjId()) {
594 return false;
595 }
596 }
597 return true;
598 }
599
600 $deadline = $this->getDeadlineHours();
601 if ($deadline) {
602 $entry = new ilCalendarEntry($a_entry_id);
603 if (time() + ($deadline * 60 * 60) > $entry->getStart()->get(IL_CAL_UNIX)) {
604 return true;
605 }
606 }
607 return false;
608 }
609
613 public function isAppointmentBookableForUser(int $a_app_id, int $a_user_id): bool
614 {
615 // #12025
616 if ($a_user_id == ANONYMOUS_USER_ID) {
617 return false;
618 }
619 // Check max bookings
620 if ($this->getNumberOfBookings() <= $this->getCurrentNumberOfBookings($a_app_id)) {
621 return false;
622 }
623
624 // Check deadline
625 $dead_limit = new ilDateTime(time(), IL_CAL_UNIX);
626 $dead_limit->increment(IL_CAL_HOUR, $this->getDeadlineHours());
627
628 $entry = new ilCalendarEntry($a_app_id);
629 if (ilDateTime::_after($dead_limit, $entry->getStart())) {
630 return false;
631 }
632
633 // Check group restrictions
634 if (!$this->getBookingGroup()) {
635 return true;
636 }
638 $this->getObjId(),
639 $this->getBookingGroup()
640 );
641
642 // Number of bookings in group
643 $bookings = self::lookupBookingsOfUser($group_apps, $a_user_id);
644
645 if (count($bookings) >= ilConsultationHourGroups::lookupMaxBookings($this->getBookingGroup())) {
646 return false;
647 }
648 return true;
649 }
650
654 public function book(int $a_entry_id, ?int $a_user_id = null): bool
655 {
656 if (!$a_user_id) {
657 $a_user_id = $this->user->getId();
658 }
659
660 if (!$this->hasBooked($a_entry_id, $a_user_id)) {
661 $this->db->manipulate('INSERT INTO booking_user (entry_id, user_id, tstamp)' .
662 ' VALUES (' . $this->db->quote($a_entry_id, 'integer') . ',' .
663 $this->db->quote($a_user_id, 'integer') . ',' . $this->db->quote(time(), 'integer') . ')');
664
665 $mail = new ilCalendarMailNotification();
666 $mail->setAppointmentId($a_entry_id);
667 $mail->setRecipients(array($a_user_id));
669 $mail->send();
670 }
671 return true;
672 }
673
677 public function cancelBooking(int $a_entry_id, ?int $a_user_id = null): bool
678 {
679 if (!$a_user_id) {
680 $a_user_id = $this->user->getId();
681 }
682
683 // @todo do not send mails about past consultation hours
684 $entry = new ilCalendarEntry($a_entry_id);
685
686 $past = ilDateTime::_before($entry->getStart(), new ilDateTime(time(), IL_CAL_UNIX));
687 if ($this->hasBooked($a_entry_id, $a_user_id) && !$past) {
688 $mail = new ilCalendarMailNotification();
689 $mail->setAppointmentId($a_entry_id);
690 $mail->setRecipients(array($a_user_id));
692 $mail->send();
693 }
694 $this->deleteBooking($a_entry_id, $a_user_id);
695 return true;
696 }
697
701 public function deleteBooking(int $a_entry_id, int $a_user_id): bool
702 {
703 $query = 'DELETE FROM booking_user ' .
704 'WHERE entry_id = ' . $this->db->quote($a_entry_id, 'integer') . ' ' .
705 'AND user_id = ' . $this->db->quote($a_user_id, 'integer');
706 $this->db->manipulate($query);
707 return true;
708 }
709}
const IL_CAL_UNIX
const IL_CAL_DATETIME
const IL_CAL_HOUR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
book(int $a_entry_id, ?int $a_user_id=null)
book calendar entry for user
static getInstanceByCalendarEntryId(int $a_id)
Get instance by calendar entry.
getCurrentNumberOfBookings(int $a_entry_id)
get current number of bookings
static hasObjectBookingEntries(int $a_obj_id, int $a_usr_id)
Check if object has assigned consultation hour appointments.
isTargetObjectVisible(int $a_ref_id)
Check if target ref id is visible.
static lookupBookingsOfUser(array $a_app_ids, int $a_usr_id, ?ilDateTime $start=null)
Lookup bookings of user.
isOwner(?int $a_user_id=null)
check if current (or given) user is entry owner
static isBookable(array $a_obj_ids, ?int $a_target_obj_id=null)
Which objects are bookable?
static removeObsoleteEntries()
Remove unused booking entries.
setDeadlineHours(int $a_hours)
hasBooked(int $a_entry_id, ?int $a_user_id=null)
get current number of bookings
static lookupBookingsForAppointment(int $a_app_id)
Lookup booked users for appointment.
setTargetObjIds(?array $a_obj_id)
__construct(int $a_booking_id=0)
Constructor.
deleteBooking(int $a_entry_id, int $a_user_id)
Delete booking.
isAppointmentBookableForUser(int $a_app_id, int $a_user_id)
Check if a calendar appointment is bookable for a specific user.
static lookupBookingMessage(int $a_entry_id, int $a_usr_id)
cancelBooking(int $a_entry_id, ?int $a_user_id=null)
cancel calendar booking for user
isBookedOut(int $a_entry_id, bool $a_check_current_user=false)
get current number of bookings
static lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
getCurrentBookings(int $a_entry_id)
get current bookings
static resetGroup(int $a_group_id)
Reset booking group (in case of deletion)
static writeBookingMessage(int $a_entry_id, int $a_usr_id, string $a_message)
Write booking message.
static lookupBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup booking for an object and user.
static lookupBookableUsersForObject(array $a_obj_id, array $a_user_ids)
Consultation hours are offered if 1) consultation hour owner is admin or tutor and no object assignme...
setNumberOfBookings(int $a_num)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Distributes calendar mail notifications.
static getAppointmentIdsByGroup(int $a_user_id, int $a_ch_group_id, ?ilDateTime $start=null)
Get appointment ids by consultation hour group.
static lookupMaxBookings(int $a_group_id)
Lookup max number of bookings for group.
static lookupManagedUsers($a_usr_id)
Lookup managed users.
@classDescription Date and time handling
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
User class.
static _lookupFullname(int $a_user_id)
static _lookupObjId(int $ref_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28
Interface ilDBInterface.
$res
Definition: ltiservices.php:69
$query