Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
event.php
1<?php
2
3
5
6
7class Event extends ParserComponent
8{
9 public const COMPONENT_TYPE = 'VEVENT';
10 private $alerts = [];
11 private $start;
12 private $end;
13 private $name;
14 private $description;
15 private $uid;
16 private $created;
17 private $transparent;
18 private $attendees = [];
19 private $organizer;
20 private $status;
21 private $rrule;
22 private $location;
23 private $modified;
24 private $sequence;
25 private $dtstamp;
26 private $url;
27 private $categories;
28 private $exDate;
29 private ?ParserPropertyType $recurrenceId;
30 private $attachments = [];
31
36 public static function createInstance(string $uid): Event
37 {
38 return new self($uid);
39 }
40
45 public function __construct(string $uid)
46 {
47 $this->uid = $uid;
48 }
49
53 public function getType(): string
54 {
56 }
57
61 public function getProperties(): array
62 {
63 return [
64 'STARTS',
65 'ENDS',
66 ];
67 }
68
73 public function setStart(?ParserPropertyType $start): Event
74 {
75 $this->start = $start;
76
77 return $this;
78 }
79
84 public function setEnd(?ParserPropertyType $end): Event
85 {
86 $this->end = $end;
87
88 return $this;
89 }
90
95 public function setDescription(?ParserPropertyType $description): Event
96 {
97 $this->description = $description;
98
99 return $this;
100 }
101
106 public function setSummary(?ParserPropertyType $summary): Event
107 {
108 $this->name = $summary;
109
110 return $this;
111 }
112
117 public function setSequence(?ParserPropertyType $sequence): Event
118 {
119 $this->sequence = $sequence;
120
121 return $this;
122 }
123
128 public function setCreated(?ParserPropertyType $created): Event
129 {
130 $this->created = $created;
131
132 return $this;
133 }
134
139 public function setDTStamp(?ParserPropertyType $dtstamp): Event
140 {
141 $this->dtstamp = $dtstamp;
142 return $this;
143 }
144
149 public function setLocation(?ParserPropertyType $location): Event
150 {
151 $this->location = $location;
152
153 return $this;
154 }
155
160 public function setUrl(?ParserPropertyType $url): Event
161 {
162 $this->url = $url;
163
164 return $this;
165 }
166
171 public function setRRule(?ParserPropertyType $rrule): Event
172 {
173 $this->rrule = $rrule;
174
175 return $this;
176 }
177
182 public function setTransparent(?ParserPropertyType $transparent): Event
183 {
184 $this->transparent = $transparent;
185
186 return $this;
187 }
188
193 public function setCategories(?ParserPropertyType $categories): Event
194 {
195 $this->categories = $categories;
196
197 return $this;
198 }
199
204 public function setOrganizer(?ParserPropertyType $organizer): Event
205 {
206 $this->organizer = $organizer;
207
208 return $this;
209 }
210
215 public function setAttendees(?array $attendees): Event
216 {
217 $this->attendees = $attendees;
218
219 return $this;
220 }
221
226 public function setModified(?ParserPropertyType $modified): Event
227 {
228 $this->modified = $modified;
229
230 return $this;
231 }
232
237 public function setExDate(?ParserPropertyType $exDate): Event
238 {
239 $this->exDate = $exDate;
240
241 return $this;
242 }
243
248 public function setStatus(?ParserPropertyType $status): Event
249 {
250 $this->status = $status;
251
252 return $this;
253 }
254
259 public function setAttachment(?array $attachments): Event
260 {
261 $this->attachments = $attachments;
262
263 return $this;
264 }
265
270 public function setSubComponents(?iterable $subComponents): Event
271 {
272 if (!is_null($subComponents))
273 {
274 foreach ($subComponents as $subComponent)
275 {
276 if ($subComponent->getType() === 'alert')
277 {
278 $this->alerts[] = $subComponent;
279 }
280 }
281 }
282
283 return $this;
284 }
285
289 public function getContent(): Event
290 {
291 return $this;
292 }
293
297 public function getStart(): ?ParserPropertyType
298 {
299 return $this->start;
300 }
301
305 public function getEnd(): ?ParserPropertyType
306 {
307 return $this->end;
308 }
309
314 {
315 return $this->description;
316 }
317
321 public function getName(): ?ParserPropertyType
322 {
323 return $this->name;
324 }
325
329 public function getUid(): ?string
330 {
331 return $this->uid;
332 }
333
337 public function getCreated(): ?ParserPropertyType
338 {
339 return $this->created;
340 }
341
345 public function getModified(): ?ParserPropertyType
346 {
347 return $this->modified;
348 }
349
353 public function getStatus(): ?ParserPropertyType
354 {
355 return $this->status;
356 }
357
361 public function getLocation(): ?ParserPropertyType
362 {
363 return $this->location;
364 }
365
369 public function getAlert(): array
370 {
371 return $this->alerts;
372 }
373
377 public function getRRule(): ?ParserPropertyType
378 {
379 return $this->rrule;
380 }
381
385 public function getExDate(): ?ParserPropertyType
386 {
387 return $this->exDate;
388 }
389
394 {
395 return $this->transparent;
396 }
397
402 {
403 return $this->organizer;
404 }
405
409 public function getAttendees(): ?array
410 {
411 return $this->attendees;
412 }
413
414 public function getDtStamp(): ?ParserPropertyType
415 {
416 return $this->dtstamp;
417 }
418
422 public function getUrl(): ?ParserPropertyType
423 {
424 return $this->url;
425 }
426
431 {
432 return $this->categories;
433 }
434
438 public function getSequence(): ?ParserPropertyType
439 {
440 return $this->sequence;
441 }
442
446 public function getAttachments(): ?array
447 {
448 return $this->attachments;
449 }
450
451 public function setRecurrenceId(?ParserPropertyType $recurrenceId): static
452 {
453 $this->recurrenceId = $recurrenceId;
454
455 return $this;
456 }
457
459 {
460 return $this->recurrenceId;
461 }
462}
setLocation(?ParserPropertyType $location)
Definition event.php:149
setAttachment(?array $attachments)
Definition event.php:259
setAttendees(?array $attendees)
Definition event.php:215
setExDate(?ParserPropertyType $exDate)
Definition event.php:237
setDTStamp(?ParserPropertyType $dtstamp)
Definition event.php:139
setRRule(?ParserPropertyType $rrule)
Definition event.php:171
setSummary(?ParserPropertyType $summary)
Definition event.php:106
setCategories(?ParserPropertyType $categories)
Definition event.php:193
setDescription(?ParserPropertyType $description)
Definition event.php:95
setEnd(?ParserPropertyType $end)
Definition event.php:84
setTransparent(?ParserPropertyType $transparent)
Definition event.php:182
setStart(?ParserPropertyType $start)
Definition event.php:73
static createInstance(string $uid)
Definition event.php:36
setSubComponents(?iterable $subComponents)
Definition event.php:270
setModified(?ParserPropertyType $modified)
Definition event.php:226
setStatus(?ParserPropertyType $status)
Definition event.php:248
setCreated(?ParserPropertyType $created)
Definition event.php:128
setSequence(?ParserPropertyType $sequence)
Definition event.php:117
setUrl(?ParserPropertyType $url)
Definition event.php:160
setRecurrenceId(?ParserPropertyType $recurrenceId)
Definition event.php:451
setOrganizer(?ParserPropertyType $organizer)
Definition event.php:204