Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
attendee.php
1<?php
2
3
5
6
7use Bitrix\Calendar\SerializeObject;
8use Serializable;
9
10class Attendee implements Serializable
11{
12 use SerializeObject;
13
14 private bool $rsvp = true;
15
19 private $email;
23 private $name;
27 private $lastName;
31 private $participationStatus;
35 private $role;
39 private $cutype;
43 private $mailto;
44
56 public static function createInstance(
57 string $email = null,
58 string $name = null,
59 string $lastName = null,
60 string $participationStatus = null,
61 string $role = null,
62 string $cutype = null,
63 string $mailto = null,
64 bool $rsvp = true
65 ): Attendee
66 {
67 return new self(
68 $email,
69 $name,
70 $lastName,
71 $participationStatus,
72 $role,
73 $cutype,
74 $mailto,
75 $rsvp
76 );
77 }
78
90 public function __construct(
91 string $email = null,
92 string $name = null,
93 string $lastName = null,
94 string $participationStatus = null,
95 string $role = null,
96 string $cutype = null,
97 string $mailto = null,
98 bool $rsvp = true
99 )
100 {
101 $this->email = $email;
102 $this->name = $name;
103 $this->lastName = $lastName;
104 $this->participationStatus = $participationStatus;
105 $this->role = $role;
106 $this->cutype = $cutype;
107 $this->mailto = $mailto;
108 $this->rsvp = $rsvp;
109 }
110
114 public function getFullName(): ?string
115 {
116 if ($this->name || $this->lastName)
117 {
118 return trim("{$this->name} {$this->lastName}");
119 }
120
121 return $this->email;
122 }
123
127 public function getEmail(): ?string
128 {
129 return $this->email ?? $this->mailto;
130 }
131
135 public function getStatus(): ?string
136 {
137 return $this->participationStatus;
138 }
139
143 public function getRole(): ?string
144 {
145 return $this->role;
146 }
147
151 public function getCuType(): ?string
152 {
153 return $this->cutype;
154 }
155
159 public function getMailTo(): ?string
160 {
161 return $this->mailto ?? $this->email;
162 }
163
168 public function setStatus(?string $status): Attendee
169 {
170 $this->participationStatus = $status;
171
172 return $this;
173 }
174
179 public function setName(?string $name): Attendee
180 {
181 $this->name = $name;
182
183 return $this;
184 }
185
190 public function setLastName(?string $lastName): Attendee
191 {
192 $this->lastName = $lastName;
193
194 return $this;
195 }
196
201 public function setEmail(?string $email): Attendee
202 {
203 $this->email = $email;
204
205 return $this;
206 }
207
212 public function setRole(?string $role): Attendee
213 {
214 $this->role = $role;
215
216 return $this;
217 }
218
223 public function setCutype(?string $type): Attendee
224 {
225 $this->cutype = $type;
226
227 return $this;
228 }
229
234 public function setMailto(?string $mailto): Attendee
235 {
236 $this->mailto = $mailto;
237
238 return $this;
239 }
240
245 public function setRsvp(bool $rsvp): Attendee
246 {
247 $this->rsvp = $rsvp;
248
249 return $this;
250 }
251
255 public function isRsvp(): bool
256 {
257 return $this->rsvp;
258 }
259}
__construct(string $email=null, string $name=null, string $lastName=null, string $participationStatus=null, string $role=null, string $cutype=null, string $mailto=null, bool $rsvp=true)
Definition attendee.php:90
static createInstance(string $email=null, string $name=null, string $lastName=null, string $participationStatus=null, string $role=null, string $cutype=null, string $mailto=null, bool $rsvp=true)
Definition attendee.php:56