PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
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 / Bookable / Service / PackageCustomer.php
ameliabooking / src / Domain / Entity / Bookable / Service Last commit date
Category.php 7 years ago Extra.php 2 years ago Package.php 2 years ago PackageCustomer.php 2 years ago PackageCustomerService.php 5 years ago PackageService.php 2 years ago Resource.php 2 years ago Service.php 2 years ago
PackageCustomer.php
176 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\Bookable\Service;
8
9 use AmeliaBooking\Domain\Collection\Collection;
10 use AmeliaBooking\Domain\Entity\Booking\AbstractCustomerBooking;
11 use AmeliaBooking\Domain\ValueObjects\DateTime\DateTimeValue;
12 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
13 use AmeliaBooking\Domain\ValueObjects\Number\Integer\WholeNumber;
14
15 /**
16 * Class PackageCustomer
17 *
18 * @package AmeliaBooking\Domain\Entity\Bookable\Service
19 */
20 class PackageCustomer extends AbstractCustomerBooking
21 {
22 /** @var Id */
23 private $id;
24
25 /** @var Id */
26 private $packageId;
27
28 /** @var DateTimeValue */
29 private $end;
30
31 /** @var DateTimeValue */
32 private $start;
33
34 /** @var DateTimeValue */
35 private $purchased;
36
37 /** @var Collection */
38 private $payments;
39
40 /** @var WholeNumber */
41 private $bookingsCount;
42
43 /**
44 * @return Id
45 */
46 public function getId()
47 {
48 return $this->id;
49 }
50
51 /**
52 * @param Id $id
53 */
54 public function setId(Id $id)
55 {
56 $this->id = $id;
57 }
58
59 /**
60 * @return Id
61 */
62 public function getPackageId()
63 {
64 return $this->packageId;
65 }
66
67 /**
68 * @param Id $packageId
69 */
70 public function setPackageId(Id $packageId)
71 {
72 $this->packageId = $packageId;
73 }
74
75 /**
76 * @return Collection
77 */
78 public function getPayments()
79 {
80 return $this->payments;
81 }
82
83 /**
84 * @param Collection $payments
85 */
86 public function setPayments(Collection $payments)
87 {
88 $this->payments = $payments;
89 }
90
91 /**
92 * @return DateTimeValue
93 */
94 public function getEnd()
95 {
96 return $this->end;
97 }
98
99 /**
100 * @param DateTimeValue $end
101 */
102 public function setEnd(DateTimeValue $end)
103 {
104 $this->end = $end;
105 }
106
107 /**
108 * @return DateTimeValue
109 */
110 public function getStart()
111 {
112 return $this->start;
113 }
114
115 /**
116 * @param DateTimeValue $start
117 */
118 public function setStart(DateTimeValue $start)
119 {
120 $this->start = $start;
121 }
122
123 /**
124 * @return DateTimeValue
125 */
126 public function getPurchased()
127 {
128 return $this->purchased;
129 }
130
131 /**
132 * @param DateTimeValue $purchased
133 */
134 public function setPurchased(DateTimeValue $purchased)
135 {
136 $this->purchased = $purchased;
137 }
138
139 /**
140 * @return WholeNumber
141 */
142 public function getBookingsCount()
143 {
144 return $this->bookingsCount;
145 }
146
147 /**
148 * @param WholeNumber $bookingsCount
149 */
150 public function setBookingsCount(WholeNumber $bookingsCount)
151 {
152 $this->bookingsCount = $bookingsCount;
153 }
154
155 /**
156 * @return array
157 */
158 public function toArray()
159 {
160 $dateTimeFormat = 'Y-m-d H:i:s';
161
162 return array_merge(
163 parent::toArray(),
164 [
165 'packageId' => $this->getPackageId() ? $this->getPackageId()->getValue() : null,
166 'payments' => $this->getPayments() ? $this->getPayments()->toArray() : null,
167 'start' => $this->getStart() ? $this->getStart()->getValue()->format($dateTimeFormat) : null,
168 'end' => $this->getEnd() ? $this->getEnd()->getValue()->format($dateTimeFormat) : null,
169 'purchased' => $this->getPurchased() ?
170 $this->getPurchased()->getValue()->format($dateTimeFormat) : null,
171 'bookingsCount' => $this->getBookingsCount() ? $this->getBookingsCount()->getValue() : null,
172 ]
173 );
174 }
175 }
176