PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / lib / Component / VJournal.php
ameliabooking / vendor / sabre / vobject / lib / Component Last commit date
Available.php 6 months ago VAlarm.php 6 months ago VAvailability.php 6 months ago VCalendar.php 6 months ago VCard.php 6 months ago VEvent.php 6 months ago VFreeBusy.php 6 months ago VJournal.php 6 months ago VTimeZone.php 6 months ago VTodo.php 6 months ago
VJournal.php
102 lines
1 <?php
2
3 namespace AmeliaVendor\Sabre\VObject\Component;
4
5 use DateTimeInterface;
6 use AmeliaVendor\Sabre\VObject;
7
8 /**
9 * VJournal component.
10 *
11 * This component contains some additional functionality specific for VJOURNALs.
12 *
13 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
14 * @author Evert Pot (http://evertpot.com/)
15 * @license http://sabre.io/license/ Modified BSD License
16 */
17 class VJournal extends VObject\Component
18 {
19 /**
20 * Returns true or false depending on if the event falls in the specified
21 * time-range. This is used for filtering purposes.
22 *
23 * The rules used to determine if an event falls within the specified
24 * time-range is based on the CalDAV specification.
25 *
26 * @return bool
27 */
28 public function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end)
29 {
30 $dtstart = isset($this->DTSTART) ? $this->DTSTART->getDateTime() : null;
31 if ($dtstart) {
32 $effectiveEnd = $dtstart;
33 if (!$this->DTSTART->hasTime()) {
34 $effectiveEnd = $effectiveEnd->modify('+1 day');
35 }
36
37 return $start <= $effectiveEnd && $end > $dtstart;
38 }
39
40 return false;
41 }
42
43 /**
44 * A simple list of validation rules.
45 *
46 * This is simply a list of properties, and how many times they either
47 * must or must not appear.
48 *
49 * Possible values per property:
50 * * 0 - Must not appear.
51 * * 1 - Must appear exactly once.
52 * * + - Must appear at least once.
53 * * * - Can appear any number of times.
54 * * ? - May appear, but not more than once.
55 *
56 * @var array
57 */
58 public function getValidationRules()
59 {
60 return [
61 'UID' => 1,
62 'DTSTAMP' => 1,
63
64 'CLASS' => '?',
65 'CREATED' => '?',
66 'DTSTART' => '?',
67 'LAST-MODIFIED' => '?',
68 'ORGANIZER' => '?',
69 'RECURRENCE-ID' => '?',
70 'SEQUENCE' => '?',
71 'STATUS' => '?',
72 'SUMMARY' => '?',
73 'URL' => '?',
74
75 'RRULE' => '?',
76
77 'ATTACH' => '*',
78 'ATTENDEE' => '*',
79 'CATEGORIES' => '*',
80 'COMMENT' => '*',
81 'CONTACT' => '*',
82 'DESCRIPTION' => '*',
83 'EXDATE' => '*',
84 'RELATED-TO' => '*',
85 'RDATE' => '*',
86 ];
87 }
88
89 /**
90 * This method should return a list of default property values.
91 *
92 * @return array
93 */
94 protected function getDefaults()
95 {
96 return [
97 'UID' => 'sabre-vobject-'.VObject\UUIDUtil::getUUID(),
98 'DTSTAMP' => gmdate('Ymd\\THis\\Z'),
99 ];
100 }
101 }
102