ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCalendarRecurrences.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
25{
29 public static function _getRecurrences(int $a_cal_id): array
30 {
31 global $DIC;
32
33 $ilDB = $DIC['ilDB'];
34 $query = "SELECT rule_id FROM cal_recurrence_rules " .
35 "WHERE cal_id = " . $ilDB->quote($a_cal_id, 'integer') . " ";
36 $res = $ilDB->query($query);
37 $recurrences = [];
38 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
39 $recurrences[] = new ilCalendarRecurrence((int) $row->rule_id);
40 }
41 return $recurrences;
42 }
43
44 public static function _getFirstRecurrence($a_cal_id): ilCalendarRecurrence
45 {
46 $recs = self::_getRecurrences($a_cal_id);
47 if (count($recs)) {
48 return $recs[0];
49 }
50 $new_rec = new ilCalendarRecurrence();
51 $new_rec->setEntryId($a_cal_id);
52 return $new_rec;
53 }
54}
Model of calendar entry recurrcences based on iCalendar-RFC-5545.
static _getRecurrences(int $a_cal_id)
get all recurrences of an appointment
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26