PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.1
Booking for Appointments and Events Calendar – Amelia v2.1
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 / Booking / AbstractCustomerBooking.php
ameliabooking / src / Domain / Entity / Booking Last commit date
Appointment 4 months ago Event 6 months ago AbstractBooking.php 4 months ago AbstractCustomerBooking.php 6 months ago Reservation.php 6 months ago SlotsEntities.php 6 months ago
AbstractCustomerBooking.php
193 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;
9
10 use AmeliaBooking\Domain\Entity\Coupon\Coupon;
11 use AmeliaBooking\Domain\Entity\User\Customer;
12 use AmeliaBooking\Domain\ValueObjects\Json;
13 use AmeliaBooking\Domain\ValueObjects\Number\Float\Price;
14 use AmeliaBooking\Domain\ValueObjects\String\BookingStatus;
15 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
16
17 /**
18 * Class AbstractCustomerBooking
19 *
20 * @package AmeliaBooking\Domain\Entity\Booking
21 */
22 abstract class AbstractCustomerBooking
23 {
24 /** @var Id */
25 private $id;
26
27 /** @var Id */
28 protected $customerId;
29
30 /** @var Customer */
31 protected $customer;
32
33 /** @var BookingStatus */
34 protected $status;
35
36 /** @var Id */
37 protected $couponId;
38
39 /** @var Price */
40 protected $price;
41
42 /** @var Coupon */
43 protected $coupon;
44
45 /** @var Json */
46 protected $tax;
47
48 /**
49 * @return Id
50 */
51 public function getId()
52 {
53 return $this->id;
54 }
55
56 /**
57 * @param Id $id
58 */
59 public function setId(Id $id)
60 {
61 $this->id = $id;
62 }
63
64 /**
65 * @return Id
66 */
67 public function getCustomerId()
68 {
69 return $this->customerId;
70 }
71
72 /**
73 * @param Id $customerId
74 */
75 public function setCustomerId(Id $customerId)
76 {
77 $this->customerId = $customerId;
78 }
79
80 /**
81 * @return Customer
82 */
83 public function getCustomer()
84 {
85 return $this->customer;
86 }
87
88 /**
89 * @param Customer $customer
90 */
91 public function setCustomer(Customer $customer)
92 {
93 $this->customer = $customer;
94 }
95
96 /**
97 * @return BookingStatus
98 */
99 public function getStatus()
100 {
101 return $this->status;
102 }
103
104 /**
105 * @param BookingStatus $status
106 */
107 public function setStatus(BookingStatus $status)
108 {
109 $this->status = $status;
110 }
111
112 /**
113 * @return Id
114 */
115 public function getCouponId()
116 {
117 return $this->couponId;
118 }
119
120 /**
121 * @param Id $couponId
122 */
123 public function setCouponId(Id $couponId)
124 {
125 $this->couponId = $couponId;
126 }
127
128 /**
129 * @return Coupon
130 */
131 public function getCoupon()
132 {
133 return $this->coupon;
134 }
135
136 /**
137 * @param Coupon $coupon
138 */
139 public function setCoupon(Coupon $coupon)
140 {
141 $this->coupon = $coupon;
142 }
143
144 /**
145 * @return Price
146 */
147 public function getPrice()
148 {
149 return $this->price;
150 }
151
152 /**
153 * @param Price $price
154 */
155 public function setPrice(Price $price)
156 {
157 $this->price = $price;
158 }
159
160 /**
161 * @return Json
162 */
163 public function getTax()
164 {
165 return $this->tax;
166 }
167
168 /**
169 * @param Json $tax
170 */
171 public function setTax(Json $tax)
172 {
173 $this->tax = $tax;
174 }
175
176 /**
177 * @return array
178 */
179 public function toArray()
180 {
181 return [
182 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
183 'customerId' => null !== $this->getCustomerId() ? $this->getCustomerId()->getValue() : null,
184 'customer' => null !== $this->getCustomer() ? $this->getCustomer()->toArray() : null,
185 'status' => null !== $this->getStatus() ? $this->getStatus()->getValue() : null,
186 'couponId' => null !== $this->getCouponId() ? $this->getCouponId()->getValue() : null,
187 'price' => null !== $this->getPrice() ? $this->getPrice()->getValue() : null,
188 'coupon' => null !== $this->getCoupon() ? $this->getCoupon()->toArray() : null,
189 'tax' => null !== $this->getTax() ? json_decode($this->getTax()->getValue(), true) : null,
190 ];
191 }
192 }
193