Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
attachmentcancelmanager.php
1<?php
2
3
5
6
13
19{
24 public function __construct(array $event)
25 {
26 parent::__construct($event);
27 $this->uid = $event['DAV_XML_ID'];
28 }
29
30 public function getUid(): ?string
31 {
32 if ($this->uid)
33 {
34 return $this->uid;
35 }
36
37 if ($this->event['ID'])
38 {
39 $eventFromDb = EventTable::getById($this->event['ID'])->fetch();
40
41 if ($eventFromDb && $eventFromDb['DAV_XML_ID'])
42 {
43 $this->uid = $eventFromDb['DAV_XML_ID'];
44
45 return $this->uid;
46 }
47 }
48
49 return null;
50 }
51
56 public function getContent(): string
57 {
59 $event['SKIP_TIME'] ??= null;
60 $event['CREATED'] ??= null;
61 $event['MODIFIED'] ??= null;
63 ->setMethod(mb_strtoupper(SenderCancelInvitation::METHOD))
64 ->addEvent(Event::createInstance($this->uid)
65 ->setName($event['NAME'])
66 ->setAttendees($this->event['ICAL_ATTENDEES'])
67 ->setStartsAt(Util::getDateObject($event['DATE_FROM'], $event['SKIP_TIME'], $event['TZ_FROM']))
68 ->setEndsAt(Util::getDateObject($event['DATE_TO'], $event['SKIP_TIME'], $event['TZ_TO']))
69 ->setCreatedAt(Util::getDateObject($event['CREATED'], false, $event['TZ_FROM']))
70 ->setDtStamp(Util::getDateObject($event['CREATED'], false, $event['TZ_FROM']))
71 ->setModified(Util::getDateObject($event['MODIFIED'], false, $event['TZ_FROM']))
72 ->setWithTimezone(!$event['SKIP_TIME'])
73 ->setWithTime(!$event['SKIP_TIME'])
74 ->setOrganizer($event['ICAL_ORGANIZER'], $this->getOrganizerMailTo())
75 ->setRRule($this->prepareRecurrenceRule($event['RRULE']))
76// ->setExdates($this->prepareExDate($event['EXDATE']))
77 ->setSequence((int)$event['VERSION'])
78 ->setStatus(Dictionary::EVENT_STATUS['cancelled'])
79 )
80 ->get();
81 }
82}
static createInstance(string $name=null)
Definition calendar.php:27
static getDateObject(string $date=null, ?bool $fullDay=true, ?string $tz='UTC')
Definition util.php:102