PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.2
Booking for Appointments and Events Calendar – Amelia v2.2
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 / ValueObjects / Recurring.php
ameliabooking / src / Domain / ValueObjects Last commit date
DateTime 6 months ago Number 6 months ago String 2 months ago BooleanValueObject.php 6 months ago Discount.php 6 months ago DiscountFixedValue.php 2 months ago DiscountPercentageValue.php 6 months ago Duration.php 7 years ago Gender.php 1 year ago GeoTag.php 7 years ago Json.php 6 months ago Picture.php 1 year ago PositiveDuration.php 7 years ago Priority.php 6 months ago Recurring.php 4 years ago
Recurring.php
217 lines
1 <?php
2
3 namespace AmeliaBooking\Domain\ValueObjects;
4
5 use AmeliaBooking\Domain\ValueObjects\DateTime\DateTimeValue;
6 use AmeliaBooking\Domain\ValueObjects\Number\Integer\WholeNumber;
7 use AmeliaBooking\Domain\ValueObjects\String\Cycle;
8
9 /**
10 * Class Recurring
11 *
12 * @package AmeliaBooking\Domain\ValueObjects
13 */
14 final class Recurring
15 {
16 /**
17 * @var Cycle
18 */
19 private $cycle;
20
21 /**
22 * @var WholeNumber
23 */
24 private $cycleInterval;
25
26 /**
27 * @var string
28 */
29 private $monthlyRepeat;
30
31 /**
32 * @var string
33 */
34 private $monthlyOnRepeat;
35
36 /**
37 * @var string
38 */
39 private $monthlyOnDay;
40
41 /**
42 * @var DateTimeValue
43 */
44 private $monthDate;
45
46 /**
47 * @var WholeNumber
48 */
49 private $order;
50
51 /**
52 * @var DateTimeValue
53 */
54 private $until;
55
56 /**
57 * Recurring constructor.
58 *
59 * @param Cycle $cycle
60 */
61 public function __construct(Cycle $cycle)
62 {
63 $this->cycle = $cycle;
64 }
65
66 /**
67 * @param Cycle $cycle
68 */
69 public function setCycle(Cycle $cycle)
70 {
71 $this->cycle = $cycle;
72 }
73
74 /**
75 * Return the recurring cycle
76 *
77 * @return Cycle
78 */
79 public function getCycle()
80 {
81 return $this->cycle;
82 }
83
84 /**
85 * @return WholeNumber
86 */
87 public function getCycleInterval()
88 {
89 return $this->cycleInterval;
90 }
91
92 /**
93 * @param WholeNumber $cycleInterval
94 */
95 public function setCycleInterval($cycleInterval)
96 {
97 $this->cycleInterval = $cycleInterval;
98 }
99
100 /**
101 * @return string
102 */
103 public function getMonthlyRepeat()
104 {
105 return $this->monthlyRepeat;
106 }
107
108 /**
109 * @param string $monthlyRepeat
110 */
111 public function setMonthlyRepeat($monthlyRepeat)
112 {
113 $this->monthlyRepeat = $monthlyRepeat;
114 }
115
116 /**
117 * @return string
118 */
119 public function getMonthlyOnRepeat()
120 {
121 return $this->monthlyOnRepeat;
122 }
123
124 /**
125 * @param string $monthlyOnRepeat
126 */
127 public function setMonthlyOnRepeat($monthlyOnRepeat)
128 {
129 $this->monthlyOnRepeat = $monthlyOnRepeat;
130 }
131
132 /**
133 * @return string
134 */
135 public function getMonthlyOnDay()
136 {
137 return $this->monthlyOnDay;
138 }
139
140 /**
141 * @param string $monthlyOnDay
142 */
143 public function setMonthlyOnDay($monthlyOnDay)
144 {
145 $this->monthlyOnDay = $monthlyOnDay;
146 }
147
148 /**
149 * @return DateTimeValue
150 */
151 public function getMonthDate()
152 {
153 return $this->monthDate;
154 }
155
156 /**
157 * @param DateTimeValue $monthDate
158 */
159 public function setMonthDate($monthDate)
160 {
161 $this->monthDate = $monthDate;
162 }
163
164 /**
165 * @param WholeNumber $order
166 */
167 public function setOrder(WholeNumber $order)
168 {
169 $this->order = $order;
170 }
171
172 /**
173 * Return the recurring order
174 *
175 * @return WholeNumber
176 */
177 public function getOrder()
178 {
179 return $this->order;
180 }
181
182 /**
183 * @param DateTimeValue $until
184 */
185 public function setUntil(DateTimeValue $until)
186 {
187 $this->until = $until;
188 }
189
190 /**
191 * Return the recurring end
192 *
193 * @return DateTimeValue
194 */
195 public function getUntil()
196 {
197 return $this->until;
198 }
199
200 /**
201 * @return array
202 */
203 public function toArray()
204 {
205 return [
206 'cycle' => $this->getCycle()->getValue(),
207 'order' => $this->getOrder() ? $this->getOrder()->getValue() : null,
208 'until' => $this->getUntil() ? $this->getUntil()->getValue()->format('Y-m-d H:i:s') : null,
209 'cycleInterval' => $this->getCycleInterval() ? $this->getCycleInterval()->getValue() : null,
210 'monthlyRepeat' => $this->getMonthlyRepeat(),
211 'monthDate' => $this->getMonthDate() ? $this->getMonthDate()->getValue()->format('Y-m-d H:i:s') : null,
212 'monthlyOnRepeat' => $this->getMonthlyOnRepeat(),
213 'monthlyOnDay' => $this->getMonthlyOnDay()
214 ];
215 }
216 }
217