Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / parser / data / PhutilCalendarEventNode.php
blobd3d33aa77e059bc1abeed93d4063742dcf87650f
1 <?php
3 final class PhutilCalendarEventNode
4 extends PhutilCalendarContainerNode {
6 const NODETYPE = 'event';
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;
23 public function setUID($uid) {
24 $this->uid = $uid;
25 return $this;
28 public function getUID() {
29 return $this->uid;
32 public function setName($name) {
33 $this->name = $name;
34 return $this;
37 public function getName() {
38 return $this->name;
41 public function setDescription($description) {
42 $this->description = $description;
43 return $this;
46 public function getDescription() {
47 return $this->description;
50 public function setStartDateTime(PhutilCalendarDateTime $start) {
51 $this->startDateTime = $start;
52 return $this;
55 public function getStartDateTime() {
56 return $this->startDateTime;
59 public function setEndDateTime(PhutilCalendarDateTime $end) {
60 $this->endDateTime = $end;
61 return $this;
64 public function getEndDateTime() {
65 $end = $this->endDateTime;
66 if ($end) {
67 return $end;
70 $start = $this->getStartDateTime();
71 $duration = $this->getDuration();
72 if ($start && $duration) {
73 return id(new PhutilCalendarRelativeDateTime())
74 ->setOrigin($start)
75 ->setDuration($duration);
78 // If no end date or duration are specified, the event is instantaneous.
79 return $start;
82 public function setDuration(PhutilCalendarDuration $duration) {
83 $this->duration = $duration;
84 return $this;
87 public function getDuration() {
88 return $this->duration;
91 public function setCreatedDateTime(PhutilCalendarDateTime $created) {
92 $this->createdDateTime = $created;
93 return $this;
96 public function getCreatedDateTime() {
97 return $this->createdDateTime;
100 public function setModifiedDateTime(PhutilCalendarDateTime $modified) {
101 $this->modifiedDateTime = $modified;
102 return $this;
105 public function getModifiedDateTime() {
106 return $this->modifiedDateTime;
109 public function setOrganizer(PhutilCalendarUserNode $organizer) {
110 $this->organizer = $organizer;
111 return $this;
114 public function getOrganizer() {
115 return $this->organizer;
118 public function setAttendees(array $attendees) {
119 assert_instances_of($attendees, 'PhutilCalendarUserNode');
120 $this->attendees = $attendees;
121 return $this;
124 public function getAttendees() {
125 return $this->attendees;
128 public function addAttendee(PhutilCalendarUserNode $attendee) {
129 $this->attendees[] = $attendee;
130 return $this;
133 public function setRecurrenceRule(
134 PhutilCalendarRecurrenceRule $recurrence_rule) {
135 $this->recurrenceRule = $recurrence_rule;
136 return $this;
139 public function getRecurrenceRule() {
140 return $this->recurrenceRule;
143 public function setRecurrenceExceptions(array $recurrence_exceptions) {
144 assert_instances_of($recurrence_exceptions, 'PhutilCalendarDateTime');
145 $this->recurrenceExceptions = $recurrence_exceptions;
146 return $this;
149 public function getRecurrenceExceptions() {
150 return $this->recurrenceExceptions;
153 public function setRecurrenceDates(array $recurrence_dates) {
154 assert_instances_of($recurrence_dates, 'PhutilCalendarDateTime');
155 $this->recurrenceDates = $recurrence_dates;
156 return $this;
159 public function getRecurrenceDates() {
160 return $this->recurrenceDates;
163 public function setRecurrenceID($recurrence_id) {
164 $this->recurrenceID = $recurrence_id;
165 return $this;
168 public function getRecurrenceID() {
169 return $this->recurrenceID;