Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
meetingdescription.php
1<?php
2
4
6use Serializable;
7
8class MeetingDescription extends BaseProperty implements Serializable
9{
13 private ?int $meetingCreator = null;
17 private bool $isNotify = false;
21 private bool $reInvite = false;
25 private bool $allowInvite = false;
29 private bool $hideGuests = false;
33 private ?string $hostName = null;
37 private ?string $languageId = null;
41 private ?string $mailFrom = null;
42
46 private ?int $chatId = null;
47
51 public function getFields(): array
52 {
53 return [
54 'NOTIFY' => $this->isNotify ?? null,
55 'MEETING_CREATOR' => $this->meetingCreator ?? null,
56 'REINVITE' => $this->reInvite ?? null,
57 'ALLOW_INVITE' => $this->allowInvite ?? null,
58 'HIDE_GUESTS' => $this->hideGuests ?? null,
59 'HOST_NAME' => $this->hostName ?? null,
60 'LANGUAGE_ID' => $this->languageId ?? null,
61 'MAIL_FROM' => $this->mailFrom ?? null,
62 'CHAT_ID' => $this->chatId ?? null,
63 ];
64 }
65
69 public function toString(): string
70 {
71 return $this->serialize() ?? '';
72 }
73
74 public function __serialize()
75 {
76 return $this->serialize();
77 }
78
79 public function __unserialize($data): void
80 {
81 $this->unserialize($data);
82 }
83
87 public function serialize(): ?string
88 {
89 return serialize($this->getFields());
90 }
91
96 public function unserialize($data)
97 {
98 $unserializedData = unserialize($data, ['allowed_classes' => false]);
99
100 $this->isNotify = $unserializedData['NOTIFY'] ?? false;
101 $this->meetingCreator = $unserializedData['HOST_NAME'];
102 $this->reInvite = $unserializedData['REINVITE'] ?? false;
103 $this->allowInvite = $unserializedData['ALLOW_INVITE'] ?? false;
104 $this->hideGuests = $unserializedData['HIDE_GUESTS'] ?? false;
105 $this->hostName = $unserializedData['MEETING_CREATOR'];
106 $this->languageId = $unserializedData['LANGUAGE_ID'];
107 $this->mailFrom = $unserializedData['MAIL_FROM'];
108 }
109
115 public function setMeetingCreator(?int $meetingCreator): MeetingDescription
116 {
117 $this->meetingCreator = $meetingCreator;
118
119 return $this;
120 }
121
126 public function setIsNotify(bool $isNotify): MeetingDescription
127 {
128 $this->isNotify = $isNotify;
129
130 return $this;
131 }
132
137 public function setReInvite(bool $reInvite): MeetingDescription
138 {
139 $this->reInvite = $reInvite;
140
141 return $this;
142 }
143
148 public function setAllowInvite(bool $allowInvite): MeetingDescription
149 {
150 $this->allowInvite = $allowInvite;
151
152 return $this;
153 }
154
159 public function setHideGuests(bool $hideGuests): MeetingDescription
160 {
161 $this->hideGuests = $hideGuests;
162
163 return $this;
164 }
165
170 public function setHostName(?string $hostName): MeetingDescription
171 {
172 $this->hostName = $hostName;
173
174 return $this;
175 }
176
182 public function setLanguageId(?string $languageId): MeetingDescription
183 {
184 $this->languageId = $languageId;
185
186 return $this;
187 }
188
194 public function setMailFrom(?string $mailFrom): MeetingDescription
195 {
196 $this->mailFrom = $mailFrom;
197
198 return $this;
199 }
200
206 public function setChatId(?int $chatId): MeetingDescription
207 {
208 $this->chatId = $chatId;
209
210 return $this;
211 }
212}