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