PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.25
Booking for Appointments and Events Calendar – Amelia v1.2.25
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Domain / Entity / User / Provider.php
ameliabooking / src / Domain / Entity / User Last commit date
AbstractUser.php 1 year ago Admin.php 7 years ago AppleCalendarEmployeeConnect.php 1 year ago Customer.php 2 years ago Manager.php 7 years ago Provider.php 1 year ago
Provider.php
334 lines
1 <?php
2
3 namespace AmeliaBooking\Domain\Entity\User;
4
5 use AmeliaBooking\Domain\Collection\Collection;
6 use AmeliaBooking\Domain\Entity\Google\GoogleCalendar;
7 use AmeliaBooking\Domain\Entity\Outlook\OutlookCalendar;
8 use AmeliaBooking\Domain\Entity\Stripe\StripeConnect;
9 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
10 use AmeliaBooking\Domain\ValueObjects\String\Description;
11 use AmeliaBooking\Domain\ValueObjects\String\Email;
12 use AmeliaBooking\Domain\ValueObjects\String\Name;
13 use AmeliaBooking\Domain\ValueObjects\String\Phone;
14
15 /**
16 * Class Provider
17 *
18 * @package AmeliaBooking\Domain\Entity\User
19 */
20 class Provider extends AbstractUser
21 {
22 /** @var Collection */
23 private $weekDayList;
24
25 /** @var Collection */
26 private $serviceList;
27
28 /** @var Collection */
29 private $dayOffList;
30
31 /** @var Collection */
32 private $specialDayList;
33
34 /** @var Collection */
35 private $appointmentList;
36
37 /** @var Id */
38 private $locationId;
39
40 /** @var GoogleCalendar */
41 private $googleCalendar;
42
43 /** @var OutlookCalendar */
44 private $outlookCalendar;
45
46 /** @var Name */
47 private $timeZone;
48
49 /** @var Description */
50 private $description;
51
52 /** @var Id */
53 private $badgeId;
54
55 /** @var StripeConnect */
56 private $stripeConnect;
57
58 /** @var AppleCalendarEmployeeConnect */
59 private $employeeAppleCalendar;
60
61 /**
62 * @param Name $firstName
63 * @param Name $lastName
64 * @param Email $email
65 * @param Phone $phone
66 * @param Collection $weekDayList
67 * @param Collection $serviceList
68 * @param Collection $dayOffList
69 * @param Collection $specialDayList
70 * @param Collection $appointmentList
71 */
72 public function __construct(
73 Name $firstName,
74 Name $lastName,
75 Email $email,
76 Phone $phone,
77 Collection $weekDayList,
78 Collection $serviceList,
79 Collection $dayOffList,
80 Collection $specialDayList,
81 Collection $appointmentList
82 ) {
83 parent::__construct($firstName, $lastName, $email);
84 $this->phone = $phone;
85 $this->weekDayList = $weekDayList;
86 $this->serviceList = $serviceList;
87 $this->dayOffList = $dayOffList;
88 $this->specialDayList = $specialDayList;
89 $this->appointmentList = $appointmentList;
90 }
91
92 /**
93 * Get the user type in a string form
94 */
95 public function getType()
96 {
97 return self::USER_ROLE_PROVIDER;
98 }
99
100 /**
101 * @return Collection
102 */
103 public function getWeekDayList()
104 {
105 return $this->weekDayList;
106 }
107
108 /**
109 * @param Collection $weekDayList
110 */
111 public function setWeekDayList(Collection $weekDayList)
112 {
113 $this->weekDayList = $weekDayList;
114 }
115
116 /**
117 * @return Collection
118 */
119 public function getServiceList()
120 {
121 return $this->serviceList;
122 }
123
124 /**
125 * @param Collection $serviceList
126 */
127 public function setServiceList(Collection $serviceList)
128 {
129 $this->serviceList = $serviceList;
130 }
131
132 /**
133 * @return Collection
134 */
135 public function getDayOffList()
136 {
137 return $this->dayOffList;
138 }
139
140 /**
141 * @param Collection $dayOffList
142 */
143 public function setDayOffList(Collection $dayOffList)
144 {
145 $this->dayOffList = $dayOffList;
146 }
147
148 /**
149 * @return Collection
150 */
151 public function getSpecialDayList()
152 {
153 return $this->specialDayList;
154 }
155
156 /**
157 * @param Collection $specialDayList
158 */
159 public function setSpecialDayList(Collection $specialDayList)
160 {
161 $this->specialDayList = $specialDayList;
162 }
163
164 /**
165 * @return Collection
166 */
167 public function getAppointmentList()
168 {
169 return $this->appointmentList;
170 }
171
172 /**
173 * @param Collection $appointmentList
174 */
175 public function setAppointmentList(Collection $appointmentList)
176 {
177 $this->appointmentList = $appointmentList;
178 }
179
180 /**
181 * @return Id
182 */
183 public function getLocationId()
184 {
185 return $this->locationId;
186 }
187
188 /**
189 * @param Id $locationId
190 */
191 public function setLocationId(Id $locationId)
192 {
193 $this->locationId = $locationId;
194 }
195
196 /**
197 * @return GoogleCalendar mixed
198 */
199 public function getGoogleCalendar()
200 {
201 return $this->googleCalendar;
202 }
203
204 /**
205 * @param mixed $googleCalendar
206 */
207 public function setGoogleCalendar($googleCalendar)
208 {
209 $this->googleCalendar = $googleCalendar;
210 }
211
212 /**
213 * @return OutlookCalendar mixed
214 */
215 public function getOutlookCalendar()
216 {
217 return $this->outlookCalendar;
218 }
219
220 /**
221 * @param mixed $outlookCalendar
222 */
223 public function setOutlookCalendar($outlookCalendar)
224 {
225 $this->outlookCalendar = $outlookCalendar;
226 }
227
228 /**
229 * @return Name
230 */
231 public function getTimeZone()
232 {
233 return $this->timeZone;
234 }
235
236 /**
237 * @param Name $timeZone
238 */
239 public function setTimeZone($timeZone)
240 {
241 $this->timeZone = $timeZone;
242 }
243
244 /**
245 * @return Description
246 */
247 public function getDescription()
248 {
249 return $this->description;
250 }
251
252 /**
253 * @param Description $description
254 */
255 public function setDescription($description)
256 {
257 $this->description = $description;
258 }
259
260 /**
261 * @return Id
262 */
263 public function getBadgeId()
264 {
265 return $this->badgeId;
266 }
267
268 /**
269 * @param Id $badgeId
270 */
271 public function setBadgeId(Id $badgeId)
272 {
273 $this->badgeId = $badgeId;
274 }
275
276 /**
277 * @return StripeConnect
278 */
279 public function getStripeConnect()
280 {
281 return $this->stripeConnect;
282 }
283
284 /**
285 * @param StripeConnect $stripeConnect
286 */
287 public function setStripeConnect($stripeConnect)
288 {
289 $this->stripeConnect = $stripeConnect;
290 }
291
292 /**
293 * @return AppleCalendarEmployeeConnect
294 */
295 public function getEmployeeAppleCalendar()
296 {
297 return $this->employeeAppleCalendar;
298 }
299
300 /**
301 * @param AppleCalendarEmployeeConnect $employeeAppleCalendar
302 */
303 public function setEmployeeAppleCalendar($employeeAppleCalendar)
304 {
305 $this->employeeAppleCalendar = $employeeAppleCalendar;
306 }
307
308
309 /**
310 * Returns the Provider entity fields in an array form
311 */
312 public function toArray()
313 {
314 return array_merge(
315 parent::toArray(),
316 [
317 'phone' => $this->phone->getValue(),
318 'weekDayList' => $this->weekDayList->toArray(),
319 'serviceList' => $this->serviceList->toArray(),
320 'dayOffList' => $this->dayOffList->toArray(),
321 'specialDayList' => $this->specialDayList->toArray(),
322 'locationId' => $this->getLocationId() ? $this->getLocationId()->getValue() : null,
323 'googleCalendar' => $this->getGoogleCalendar() ? $this->getGoogleCalendar()->toArray() : null,
324 'outlookCalendar' => $this->getOutlookCalendar() ? $this->getOutlookCalendar()->toArray() : null,
325 'timeZone' => $this->getTimeZone() ? $this->getTimeZone()->getValue() : null,
326 'description' => $this->getDescription() ? $this->getDescription()->getValue() : null,
327 'badgeId' => $this->getBadgeId() ? $this->getBadgeId()->getValue() : null,
328 'stripeConnect' => $this->getStripeConnect() ? $this->getStripeConnect()->toArray() : null,
329 'employeeAppleCalendar' => $this->getEmployeeAppleCalendar() ? $this->getEmployeeAppleCalendar()->toArray() : null,
330 ]
331 );
332 }
333 }
334