PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.11
Booking for Appointments and Events Calendar – Amelia v1.2.11
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 / Schedule / SpecialDay.php
ameliabooking / src / Domain / Entity / Schedule Last commit date
DayOff.php 6 years ago Period.php 3 years ago PeriodLocation.php 3 years ago PeriodService.php 6 years ago SpecialDay.php 6 years ago SpecialDayPeriod.php 3 years ago SpecialDayPeriodLocation.php 3 years ago SpecialDayPeriodService.php 6 years ago TimeOut.php 6 years ago WeekDay.php 6 years ago
SpecialDay.php
126 lines
1 <?php
2 /**
3 * @copyright © TMS-Plugins. All rights reserved.
4 * @licence See LICENCE.md for license details.
5 */
6
7 namespace AmeliaBooking\Domain\Entity\Schedule;
8
9 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
10 use AmeliaBooking\Domain\ValueObjects\DateTime\DateTimeValue;
11 use AmeliaBooking\Domain\Collection\Collection;
12
13 /**
14 * Class SpecialDay
15 *
16 * @package AmeliaBooking\Domain\Entity\Schedule
17 */
18 class SpecialDay
19 {
20 /** @var Id */
21 private $id;
22
23 /** @var DateTimeValue */
24 private $startDate;
25
26 /** @var DateTimeValue */
27 private $endDate;
28
29 /** @var Collection */
30 private $periodList;
31
32 /**
33 * SpecialDay constructor.
34 *
35 * @param DateTimeValue $startDate
36 * @param DateTimeValue $endDate
37 * @param Collection $periodList
38 */
39 public function __construct(
40 DateTimeValue $startDate,
41 DateTimeValue $endDate,
42 Collection $periodList
43 ) {
44 $this->startDate = $startDate;
45 $this->endDate = $endDate;
46 $this->periodList = $periodList;
47 }
48
49 /**
50 * @return Id
51 */
52 public function getId()
53 {
54 return $this->id;
55 }
56
57 /**
58 * @param Id $id
59 */
60 public function setId(Id $id)
61 {
62 $this->id = $id;
63 }
64
65 /**
66 * @return DateTimeValue
67 */
68 public function getStartDate()
69 {
70 return $this->startDate;
71 }
72
73 /**
74 * @param DateTimeValue $startDate
75 */
76 public function setStartDate(DateTimeValue $startDate)
77 {
78 $this->startDate = $startDate;
79 }
80
81 /**
82 * @return DateTimeValue
83 */
84 public function getEndDate()
85 {
86 return $this->endDate;
87 }
88
89 /**
90 * @param DateTimeValue $endDate
91 */
92 public function setEndDate(DateTimeValue $endDate)
93 {
94 $this->endDate = $endDate;
95 }
96
97 /**
98 * @return Collection
99 */
100 public function getPeriodList()
101 {
102 return $this->periodList;
103 }
104
105 /**
106 * @param Collection $periodList
107 */
108 public function setPeriodList(Collection $periodList)
109 {
110 $this->periodList = $periodList;
111 }
112
113 /**
114 * @return array
115 */
116 public function toArray()
117 {
118 return [
119 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
120 'startDate' => $this->startDate->getValue()->format('Y-m-d'),
121 'endDate' => $this->endDate->getValue()->format('Y-m-d'),
122 'periodList' => $this->periodList->toArray(),
123 ];
124 }
125 }
126