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