PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.27
Booking for Appointments and Events Calendar – Amelia v1.2.27
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 / Bookable / Service / Service.php
ameliabooking / src / Domain / Entity / Bookable / Service Last commit date
Category.php 1 year ago Extra.php 1 year ago Package.php 1 year ago PackageCustomer.php 1 year ago PackageCustomerService.php 1 year ago PackageService.php 1 year ago Resource.php 1 year ago Service.php 1 year ago
Service.php
496 lines
1 <?php
2
3 /**
4 * @copyright © TMS-Plugins. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace AmeliaBooking\Domain\Entity\Bookable\Service;
9
10 use AmeliaBooking\Domain\Collection\Collection;
11 use AmeliaBooking\Domain\Entity\Entities;
12 use AmeliaBooking\Domain\ValueObjects\BooleanValueObject;
13 use AmeliaBooking\Domain\ValueObjects\Json;
14 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
15 use AmeliaBooking\Domain\ValueObjects\Number\Integer\IntegerValue;
16 use AmeliaBooking\Domain\ValueObjects\Number\Integer\WholeNumber;
17 use AmeliaBooking\Domain\ValueObjects\String\BookableType;
18 use AmeliaBooking\Domain\ValueObjects\String\Cycle;
19 use AmeliaBooking\Domain\ValueObjects\String\Status;
20 use AmeliaBooking\Domain\ValueObjects\Priority;
21 use AmeliaBooking\Domain\ValueObjects\String\Name;
22 use AmeliaBooking\Domain\Entity\Bookable\AbstractBookable;
23 use AmeliaBooking\Domain\ValueObjects\Duration;
24 use AmeliaBooking\Domain\ValueObjects\PositiveDuration;
25
26 /**
27 * Class Service
28 *
29 * @package AmeliaBooking\Domain\Entity\Bookable\Service
30 */
31 class Service extends AbstractBookable
32 {
33 /** @var IntegerValue */
34 private $minCapacity;
35
36 /** @var IntegerValue */
37 private $maxCapacity;
38
39 /** @var PositiveDuration */
40 private $duration;
41
42 /** @var Duration */
43 private $timeBefore;
44
45 /** @var Duration */
46 private $timeAfter;
47
48 /** @var IntegerValue */
49 private $minSelectedExtras;
50
51 /** @var BooleanValueObject */
52 private $bringingAnyone;
53
54 /** @var BooleanValueObject */
55 private $mandatoryExtra;
56
57 /** @var Priority */
58 private $priority;
59
60 /** @var Collection */
61 private $gallery;
62
63 /** @var Status */
64 protected $status;
65
66 /** @var Id */
67 protected $categoryId;
68
69 /** @var Category */
70 protected $category;
71
72 /** @var BooleanValueObject */
73 protected $show;
74
75 /** @var BooleanValueObject */
76 protected $aggregatedPrice;
77
78 /** @var Cycle */
79 protected $recurringCycle;
80
81 /** @var Name */
82 protected $recurringSub;
83
84 /** @var WholeNumber */
85 protected $recurringPayment;
86
87 /** @var Json */
88 protected $translations;
89
90 /** @var Json */
91 protected $customPricing;
92
93 /** @var IntegerValue */
94 private $maxExtraPeople;
95
96
97 /** @var Json */
98 protected $limitPerCustomer;
99
100 /**
101 * @return Id
102 */
103 public function getCategoryId()
104 {
105 return $this->categoryId;
106 }
107
108 /**
109 * @param Id $categoryId
110 */
111 public function setCategoryId(Id $categoryId)
112 {
113 $this->categoryId = $categoryId;
114 }
115
116 /**
117 * @return Category
118 */
119 public function getCategory()
120 {
121 return $this->category;
122 }
123
124 /**
125 * @param Category $category
126 */
127 public function setCategory(Category $category)
128 {
129 $this->category = $category;
130 }
131
132 /**
133 * @return Status
134 */
135 public function getStatus()
136 {
137 return $this->status;
138 }
139
140 /**
141 * @param Status $status
142 */
143 public function setStatus(Status $status)
144 {
145 $this->status = $status;
146 }
147
148 /**
149 * @return IntegerValue
150 */
151 public function getMinCapacity()
152 {
153 return $this->minCapacity;
154 }
155
156 /**
157 * @param IntegerValue $minCapacity
158 */
159 public function setMinCapacity(IntegerValue $minCapacity)
160 {
161 $this->minCapacity = $minCapacity;
162 }
163
164 /**
165 * @return IntegerValue
166 */
167 public function getMaxCapacity()
168 {
169 return $this->maxCapacity;
170 }
171
172 /**
173 * @param IntegerValue $maxCapacity
174 */
175 public function setMaxCapacity(IntegerValue $maxCapacity)
176 {
177 $this->maxCapacity = $maxCapacity;
178 }
179
180 /**
181 * @return PositiveDuration
182 */
183 public function getDuration()
184 {
185 return $this->duration;
186 }
187
188 /**
189 * @param PositiveDuration $duration
190 */
191 public function setDuration(PositiveDuration $duration)
192 {
193 $this->duration = $duration;
194 }
195
196 /**
197 * @return Duration
198 */
199 public function getTimeBefore()
200 {
201 return $this->timeBefore;
202 }
203
204 /**
205 * @param Duration $timeBefore
206 */
207 public function setTimeBefore(Duration $timeBefore)
208 {
209 $this->timeBefore = $timeBefore;
210 }
211
212 /**
213 * @return IntegerValue
214 */
215 public function getMinSelectedExtras()
216 {
217 return $this->minSelectedExtras;
218 }
219
220 /**
221 * @param IntegerValue $minSelectedExtras
222 */
223 public function setMinSelectedExtras(IntegerValue $minSelectedExtras)
224 {
225 $this->minSelectedExtras = $minSelectedExtras;
226 }
227
228 /**
229 * @return Duration
230 */
231 public function getTimeAfter()
232 {
233 return $this->timeAfter;
234 }
235
236 /**
237 * @param Duration $timeAfter
238 */
239 public function setTimeAfter(Duration $timeAfter)
240 {
241 $this->timeAfter = $timeAfter;
242 }
243
244 /**
245 * @return BooleanValueObject
246 */
247 public function getBringingAnyone()
248 {
249 return $this->bringingAnyone;
250 }
251
252 /**
253 * @param BooleanValueObject $bringingAnyone
254 */
255 public function setBringingAnyone(BooleanValueObject $bringingAnyone)
256 {
257 $this->bringingAnyone = $bringingAnyone;
258 }
259
260 /**
261 * @return BooleanValueObject
262 */
263 public function getShow()
264 {
265 return $this->show;
266 }
267
268 /**
269 * @param BooleanValueObject $show
270 */
271 public function setShow(BooleanValueObject $show)
272 {
273 $this->show = $show;
274 }
275
276 /**
277 * @return BooleanValueObject
278 */
279 public function getAggregatedPrice()
280 {
281 return $this->aggregatedPrice;
282 }
283
284 /**
285 * @param BooleanValueObject $aggregatedPrice
286 */
287 public function setAggregatedPrice(BooleanValueObject $aggregatedPrice)
288 {
289 $this->aggregatedPrice = $aggregatedPrice;
290 }
291
292 /**
293 * @return BooleanValueObject
294 */
295 public function getMandatoryExtra()
296 {
297 return $this->mandatoryExtra;
298 }
299
300 /**
301 * @param BooleanValueObject $mandatoryExtra
302 */
303 public function setMandatoryExtra(BooleanValueObject $mandatoryExtra)
304 {
305 $this->mandatoryExtra = $mandatoryExtra;
306 }
307
308 /**
309 * @return Priority
310 */
311 public function getPriority()
312 {
313 return $this->priority;
314 }
315
316 /**
317 * @param Priority $priority
318 */
319 public function setPriority(Priority $priority)
320 {
321 $this->priority = $priority;
322 }
323
324 /**
325 * @return Collection
326 */
327 public function getGallery()
328 {
329 return $this->gallery;
330 }
331
332 /**
333 * @param Collection $gallery
334 */
335 public function setGallery(Collection $gallery)
336 {
337 $this->gallery = $gallery;
338 }
339
340 /**
341 * @return Cycle
342 */
343 public function getRecurringCycle()
344 {
345 return $this->recurringCycle;
346 }
347
348 /**
349 * @param Cycle $recurringCycle
350 */
351 public function setRecurringCycle(Cycle $recurringCycle)
352 {
353 $this->recurringCycle = $recurringCycle;
354 }
355
356 /**
357 * @return Name
358 */
359 public function getRecurringSub()
360 {
361 return $this->recurringSub;
362 }
363
364 /**
365 * @param Name $recurringSub
366 */
367 public function setRecurringSub(Name $recurringSub)
368 {
369 $this->recurringSub = $recurringSub;
370 }
371
372 /**
373 * @return WholeNumber
374 */
375 public function getRecurringPayment()
376 {
377 return $this->recurringPayment;
378 }
379
380 /**
381 * @param WholeNumber $recurringPayment
382 */
383 public function setRecurringPayment(WholeNumber $recurringPayment)
384 {
385 $this->recurringPayment = $recurringPayment;
386 }
387
388 /**
389 * @return Json
390 */
391 public function getTranslations()
392 {
393 return $this->translations;
394 }
395
396 /**
397 * @param Json $translations
398 */
399 public function setTranslations(Json $translations)
400 {
401 $this->translations = $translations;
402 }
403
404 /**
405 * @return Json
406 */
407 public function getCustomPricing()
408 {
409 return $this->customPricing;
410 }
411
412 /**
413 * @param Json $customPricing
414 */
415 public function setCustomPricing(Json $customPricing)
416 {
417 $this->customPricing = $customPricing;
418 }
419
420 /**
421 * @return IntegerValue
422 */
423 public function getMaxExtraPeople()
424 {
425 return $this->maxExtraPeople;
426 }
427
428 /**
429 * @param IntegerValue $maxExtraPeople
430 */
431 public function setMaxExtraPeople($maxExtraPeople)
432 {
433 $this->maxExtraPeople = $maxExtraPeople;
434 }
435
436
437 /**
438 * @return Json
439 */
440 public function getLimitPerCustomer()
441 {
442 return $this->limitPerCustomer;
443 }
444
445 /**
446 * @param Json $limitPerCustomer
447 */
448 public function setLimitPerCustomer($limitPerCustomer)
449 {
450 $this->limitPerCustomer = $limitPerCustomer;
451 }
452
453 /**
454 * @return BookableType
455 */
456 public function getType()
457 {
458 return new BookableType(Entities::SERVICE);
459 }
460
461
462 /**
463 * @return array
464 */
465 public function toArray()
466 {
467 return array_merge(
468 parent::toArray(),
469 [
470 'minCapacity' => $this->getMinCapacity() ? $this->getMinCapacity()->getValue() : null,
471 'maxCapacity' => $this->getMaxCapacity() ? $this->getMaxCapacity()->getValue() : null,
472 'duration' => $this->getDuration() ? $this->getDuration()->getValue() : null,
473 'timeBefore' => $this->getTimeBefore() ? $this->getTimeBefore()->getValue() : null,
474 'timeAfter' => $this->getTimeAfter() ? $this->getTimeAfter()->getValue() : null,
475 'bringingAnyone' => $this->getBringingAnyone() ? $this->getBringingAnyone()->getValue() : null,
476 'show' => $this->getShow() ? $this->getShow()->getValue() : null,
477 'aggregatedPrice' => $this->getAggregatedPrice() ? $this->getAggregatedPrice()->getValue() : null,
478 'status' => $this->getStatus() ? $this->getStatus()->getValue() : null,
479 'categoryId' => $this->getCategoryId() ? $this->getCategoryId()->getValue() : null,
480 'category' => $this->getCategory() ? $this->getCategory()->toArray() : null,
481 'priority' => $this->getPriority() ? $this->getPriority()->getValue() : [],
482 'gallery' => $this->getGallery() ? $this->getGallery()->toArray() : [],
483 'recurringCycle' => $this->getRecurringCycle() ? $this->getRecurringCycle()->getValue() : null,
484 'recurringSub' => $this->getRecurringSub() ? $this->getRecurringSub()->getValue() : null,
485 'recurringPayment' => $this->getRecurringPayment() ? $this->getRecurringPayment()->getValue() : null,
486 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null,
487 'minSelectedExtras' => $this->getMinSelectedExtras() ? $this->getMinSelectedExtras()->getValue() : null,
488 'mandatoryExtra' => $this->getMandatoryExtra() ? $this->getMandatoryExtra()->getValue() : null,
489 'customPricing' => $this->getCustomPricing() ? $this->getCustomPricing()->getValue() : null,
490 'maxExtraPeople' => $this->getMaxExtraPeople() ? $this->getMaxExtraPeople()->getValue() : null,
491 'limitPerCustomer' => $this->getLimitPerCustomer() ? $this->getLimitPerCustomer()->getValue() : null,
492 ]
493 );
494 }
495 }
496