3 final class PhutilCalendarEventNode
4 extends PhutilCalendarContainerNode
{
6 const NODETYPE
= 'event';
11 private $startDateTime;
14 private $createdDateTime;
15 private $modifiedDateTime;
17 private $attendees = array();
18 private $recurrenceRule;
19 private $recurrenceExceptions = array();
20 private $recurrenceDates = array();
21 private $recurrenceID;
23 public function setUID($uid) {
28 public function getUID() {
32 public function setName($name) {
37 public function getName() {
41 public function setDescription($description) {
42 $this->description
= $description;
46 public function getDescription() {
47 return $this->description
;
50 public function setStartDateTime(PhutilCalendarDateTime
$start) {
51 $this->startDateTime
= $start;
55 public function getStartDateTime() {
56 return $this->startDateTime
;
59 public function setEndDateTime(PhutilCalendarDateTime
$end) {
60 $this->endDateTime
= $end;
64 public function getEndDateTime() {
65 $end = $this->endDateTime
;
70 $start = $this->getStartDateTime();
71 $duration = $this->getDuration();
72 if ($start && $duration) {
73 return id(new PhutilCalendarRelativeDateTime())
75 ->setDuration($duration);
78 // If no end date or duration are specified, the event is instantaneous.
82 public function setDuration(PhutilCalendarDuration
$duration) {
83 $this->duration
= $duration;
87 public function getDuration() {
88 return $this->duration
;
91 public function setCreatedDateTime(PhutilCalendarDateTime
$created) {
92 $this->createdDateTime
= $created;
96 public function getCreatedDateTime() {
97 return $this->createdDateTime
;
100 public function setModifiedDateTime(PhutilCalendarDateTime
$modified) {
101 $this->modifiedDateTime
= $modified;
105 public function getModifiedDateTime() {
106 return $this->modifiedDateTime
;
109 public function setOrganizer(PhutilCalendarUserNode
$organizer) {
110 $this->organizer
= $organizer;
114 public function getOrganizer() {
115 return $this->organizer
;
118 public function setAttendees(array $attendees) {
119 assert_instances_of($attendees, 'PhutilCalendarUserNode');
120 $this->attendees
= $attendees;
124 public function getAttendees() {
125 return $this->attendees
;
128 public function addAttendee(PhutilCalendarUserNode
$attendee) {
129 $this->attendees
[] = $attendee;
133 public function setRecurrenceRule(
134 PhutilCalendarRecurrenceRule
$recurrence_rule) {
135 $this->recurrenceRule
= $recurrence_rule;
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;
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;
159 public function getRecurrenceDates() {
160 return $this->recurrenceDates
;
163 public function setRecurrenceID($recurrence_id) {
164 $this->recurrenceID
= $recurrence_id;
168 public function getRecurrenceID() {
169 return $this->recurrenceID
;