Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/parser/data/PhutilCalendarEventNode.php
12262 views
1
<?php
2
3
final class PhutilCalendarEventNode
4
extends PhutilCalendarContainerNode {
5
6
const NODETYPE = 'event';
7
8
private $uid;
9
private $name;
10
private $description;
11
private $startDateTime;
12
private $endDateTime;
13
private $duration;
14
private $createdDateTime;
15
private $modifiedDateTime;
16
private $organizer;
17
private $attendees = array();
18
private $recurrenceRule;
19
private $recurrenceExceptions = array();
20
private $recurrenceDates = array();
21
private $recurrenceID;
22
23
public function setUID($uid) {
24
$this->uid = $uid;
25
return $this;
26
}
27
28
public function getUID() {
29
return $this->uid;
30
}
31
32
public function setName($name) {
33
$this->name = $name;
34
return $this;
35
}
36
37
public function getName() {
38
return $this->name;
39
}
40
41
public function setDescription($description) {
42
$this->description = $description;
43
return $this;
44
}
45
46
public function getDescription() {
47
return $this->description;
48
}
49
50
public function setStartDateTime(PhutilCalendarDateTime $start) {
51
$this->startDateTime = $start;
52
return $this;
53
}
54
55
public function getStartDateTime() {
56
return $this->startDateTime;
57
}
58
59
public function setEndDateTime(PhutilCalendarDateTime $end) {
60
$this->endDateTime = $end;
61
return $this;
62
}
63
64
public function getEndDateTime() {
65
$end = $this->endDateTime;
66
if ($end) {
67
return $end;
68
}
69
70
$start = $this->getStartDateTime();
71
$duration = $this->getDuration();
72
if ($start && $duration) {
73
return id(new PhutilCalendarRelativeDateTime())
74
->setOrigin($start)
75
->setDuration($duration);
76
}
77
78
// If no end date or duration are specified, the event is instantaneous.
79
return $start;
80
}
81
82
public function setDuration(PhutilCalendarDuration $duration) {
83
$this->duration = $duration;
84
return $this;
85
}
86
87
public function getDuration() {
88
return $this->duration;
89
}
90
91
public function setCreatedDateTime(PhutilCalendarDateTime $created) {
92
$this->createdDateTime = $created;
93
return $this;
94
}
95
96
public function getCreatedDateTime() {
97
return $this->createdDateTime;
98
}
99
100
public function setModifiedDateTime(PhutilCalendarDateTime $modified) {
101
$this->modifiedDateTime = $modified;
102
return $this;
103
}
104
105
public function getModifiedDateTime() {
106
return $this->modifiedDateTime;
107
}
108
109
public function setOrganizer(PhutilCalendarUserNode $organizer) {
110
$this->organizer = $organizer;
111
return $this;
112
}
113
114
public function getOrganizer() {
115
return $this->organizer;
116
}
117
118
public function setAttendees(array $attendees) {
119
assert_instances_of($attendees, 'PhutilCalendarUserNode');
120
$this->attendees = $attendees;
121
return $this;
122
}
123
124
public function getAttendees() {
125
return $this->attendees;
126
}
127
128
public function addAttendee(PhutilCalendarUserNode $attendee) {
129
$this->attendees[] = $attendee;
130
return $this;
131
}
132
133
public function setRecurrenceRule(
134
PhutilCalendarRecurrenceRule $recurrence_rule) {
135
$this->recurrenceRule = $recurrence_rule;
136
return $this;
137
}
138
139
public function getRecurrenceRule() {
140
return $this->recurrenceRule;
141
}
142
143
public function setRecurrenceExceptions(array $recurrence_exceptions) {
144
assert_instances_of($recurrence_exceptions, 'PhutilCalendarDateTime');
145
$this->recurrenceExceptions = $recurrence_exceptions;
146
return $this;
147
}
148
149
public function getRecurrenceExceptions() {
150
return $this->recurrenceExceptions;
151
}
152
153
public function setRecurrenceDates(array $recurrence_dates) {
154
assert_instances_of($recurrence_dates, 'PhutilCalendarDateTime');
155
$this->recurrenceDates = $recurrence_dates;
156
return $this;
157
}
158
159
public function getRecurrenceDates() {
160
return $this->recurrenceDates;
161
}
162
163
public function setRecurrenceID($recurrence_id) {
164
$this->recurrenceID = $recurrence_id;
165
return $this;
166
}
167
168
public function getRecurrenceID() {
169
return $this->recurrenceID;
170
}
171
172
}
173
174