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 / Booking / Event / EventTicket.php
ameliabooking / src / Domain / Entity / Booking / Event Last commit date
CustomerBookingEventPeriod.php 6 months ago CustomerBookingEventTicket.php 6 months ago Event.php 3 months ago EventPeriod.php 6 months ago EventTag.php 2 months ago EventTicket.php 6 months ago
EventTicket.php
274 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\Booking\Event;
9
10 use AmeliaBooking\Domain\ValueObjects\BooleanValueObject;
11 use AmeliaBooking\Domain\ValueObjects\Json;
12 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
13 use AmeliaBooking\Domain\ValueObjects\Number\Integer\IntegerValue;
14 use AmeliaBooking\Domain\ValueObjects\String\Name;
15 use AmeliaBooking\Domain\ValueObjects\Number\Float\Price;
16
17 /**
18 * Class EventTicket
19 *
20 * @package AmeliaBooking\Domain\Entity\Booking\Event
21 */
22 class EventTicket
23 {
24 /** @var Id */
25 private $id;
26
27 /** @var Id */
28 private $eventId;
29
30 /** @var Name */
31 protected $name;
32
33 /** @var BooleanValueObject */
34 private $enabled;
35
36 /** @var Price */
37 protected $price;
38
39 /** @var Price */
40 protected $dateRangePrice;
41
42 /** @var IntegerValue */
43 private $spots;
44
45 /** @var IntegerValue */
46 private $waiting;
47
48 /** @var IntegerValue */
49 private $waitingListSpots;
50
51 /** @var Json */
52 protected $dateRanges;
53
54 /** @var IntegerValue */
55 private $sold;
56
57 /** @var Json */
58 protected $translations;
59
60 /**
61 * @return Json
62 */
63 public function getDateRanges()
64 {
65 return $this->dateRanges;
66 }
67
68 /**
69 * @param Json $dateRanges
70 */
71 public function setDateRanges($dateRanges)
72 {
73 $this->dateRanges = $dateRanges;
74 }
75
76 /**
77 * @return IntegerValue
78 */
79 public function getSpots()
80 {
81 return $this->spots;
82 }
83
84 /**
85 * @param IntegerValue $spots
86 */
87 public function setSpots($spots)
88 {
89 $this->spots = $spots;
90 }
91
92 /**
93 * @return IntegerValue
94 */
95 public function getWaitingListSpots()
96 {
97 return $this->waitingListSpots;
98 }
99
100 /**
101 * @param IntegerValue $waitingListSpots
102 */
103 public function setWaitingListSpots($waitingListSpots)
104 {
105 $this->waitingListSpots = $waitingListSpots;
106 }
107
108 /**
109 * @return Price
110 */
111 public function getPrice()
112 {
113 return $this->price;
114 }
115
116 /**
117 * @param Price $price
118 */
119 public function setPrice($price)
120 {
121 $this->price = $price;
122 }
123
124 /**
125 * @return Price
126 */
127 public function getDateRangePrice()
128 {
129 return $this->dateRangePrice;
130 }
131
132 /**
133 * @param Price $dateRangePrice
134 */
135 public function setDateRangePrice($dateRangePrice)
136 {
137 $this->dateRangePrice = $dateRangePrice;
138 }
139
140 /**
141 * @return Name
142 */
143 public function getName()
144 {
145 return $this->name;
146 }
147
148 /**
149 * @param Name $name
150 */
151 public function setName($name)
152 {
153 $this->name = $name;
154 }
155
156 /**
157 * @return BooleanValueObject
158 */
159 public function getEnabled()
160 {
161 return $this->enabled;
162 }
163
164 /**
165 * @param BooleanValueObject $enabled
166 */
167 public function setEnabled($enabled)
168 {
169 $this->enabled = $enabled;
170 }
171
172 /**
173 * @return Id
174 */
175 public function getEventId()
176 {
177 return $this->eventId;
178 }
179
180 /**
181 * @param Id $eventId
182 */
183 public function setEventId($eventId)
184 {
185 $this->eventId = $eventId;
186 }
187
188 /**
189 * @return Id
190 */
191 public function getId()
192 {
193 return $this->id;
194 }
195
196 /**
197 * @param Id $id
198 */
199 public function setId($id)
200 {
201 $this->id = $id;
202 }
203
204 /**
205 * @return IntegerValue
206 */
207 public function getSold()
208 {
209 return $this->sold;
210 }
211
212 /**
213 * @param IntegerValue $sold
214 */
215 public function setSold($sold)
216 {
217 $this->sold = $sold;
218 }
219
220 /**
221 * @return IntegerValue
222 */
223 public function getWaiting()
224 {
225 return $this->waiting;
226 }
227
228 /**
229 * @param IntegerValue $waiting
230 */
231 public function setWaiting($waiting)
232 {
233 $this->waiting = $waiting;
234 }
235
236 /**
237 * @return Json
238 */
239 public function getTranslations()
240 {
241 return $this->translations;
242 }
243
244 /**
245 * @param Json $translations
246 */
247 public function setTranslations(Json $translations)
248 {
249 $this->translations = $translations;
250 }
251
252
253 /**
254 * @return array
255 */
256 public function toArray()
257 {
258 return [
259 'id' => $this->getId() ? $this->getId()->getValue() : null,
260 'eventId' => $this->getEventId() ? $this->getEventId()->getValue() : null,
261 'name' => $this->getName() ? $this->getName()->getValue() : null,
262 'enabled' => $this->getEnabled() ? $this->getEnabled()->getValue() : null,
263 'price' => $this->getPrice() ? $this->getPrice()->getValue() : null,
264 'dateRangePrice' => $this->getDateRangePrice() ? $this->getDateRangePrice()->getValue() : null,
265 'spots' => $this->getSpots() ? $this->getSpots()->getValue() : null,
266 'waitingListSpots' => $this->getWaitingListSpots() ? $this->getWaitingListSpots()->getValue() : null,
267 'dateRanges' => $this->getDateRanges() ? $this->getDateRanges()->getValue() : null,
268 'sold' => $this->getSold() ? $this->getSold()->getValue() : 0,
269 'waiting' => $this->getWaiting() ? $this->getWaiting()->getValue() : 0,
270 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null,
271 ];
272 }
273 }
274