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 / Bookable / AbstractCategory.php
ameliabooking / src / Domain / Entity / Bookable Last commit date
Service 2 years ago AbstractBookable.php 2 years ago AbstractCategory.php 2 years ago AbstractExtra.php 2 years ago
AbstractCategory.php
215 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;
8
9 use AmeliaBooking\Domain\Collection\Collection;
10 use AmeliaBooking\Domain\ValueObjects\Json;
11 use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id;
12 use AmeliaBooking\Domain\ValueObjects\Picture;
13 use AmeliaBooking\Domain\ValueObjects\String\Color;
14 use AmeliaBooking\Domain\ValueObjects\String\Status;
15 use AmeliaBooking\Domain\ValueObjects\Number\Integer\PositiveInteger;
16 use AmeliaBooking\Domain\ValueObjects\String\Name;
17
18 /**
19 * Class AbstractCategory
20 *
21 * @package AmeliaBooking\Domain\Entity\Bookable
22 */
23 abstract class AbstractCategory
24 {
25 /** @var Id */
26 private $id;
27
28 /** @var Status */
29 protected $status;
30
31 /** @var Name */
32 protected $name;
33
34 /** @var Collection */
35 private $serviceList;
36
37 /** @var PositiveInteger */
38 protected $position;
39
40 /** @var Json */
41 protected $translations;
42
43 /** @var Color */
44 protected $color;
45
46 /** @var Picture */
47 protected $picture;
48
49 /**
50 * AbstractCategory constructor.
51 *
52 * @param Status $status
53 * @param Name $name
54 * @param PositiveInteger $position
55 * @param Color $color
56 */
57 public function __construct(
58 Status $status,
59 Name $name,
60 PositiveInteger $position,
61 Color $color
62 ) {
63 $this->status = $status;
64 $this->name = $name;
65 $this->position = $position;
66 $this->color = $color;
67 }
68
69 /**
70 * @return Id
71 */
72 public function getId()
73 {
74 return $this->id;
75 }
76
77 /**
78 * @param Id $id
79 */
80 public function setId(Id $id)
81 {
82 $this->id = $id;
83 }
84
85 /**
86 * @return Status
87 */
88 public function getStatus()
89 {
90 return $this->status;
91 }
92
93 /**
94 * @param Status $status
95 */
96 public function setStatus(Status $status)
97 {
98 $this->status = $status;
99 }
100
101 /**
102 * @return Name
103 */
104 public function getName()
105 {
106 return $this->name;
107 }
108
109 /**
110 * @param Name $name
111 */
112 public function setName(Name $name)
113 {
114 $this->name = $name;
115 }
116
117 /**
118 * @return Collection
119 */
120 public function getServiceList()
121 {
122 return $this->serviceList;
123 }
124
125 /**
126 * @param Collection $serviceList
127 */
128 public function setServiceList(Collection $serviceList)
129 {
130 $this->serviceList = $serviceList;
131 }
132
133 /**
134 * @return PositiveInteger
135 */
136 public function getPosition()
137 {
138 return $this->position;
139 }
140
141 /**
142 * @param PositiveInteger $position
143 */
144 public function setPosition($position)
145 {
146 $this->position = $position;
147 }
148
149 /**
150 * @return Json
151 */
152 public function getTranslations()
153 {
154 return $this->translations;
155 }
156
157 /**
158 * @param Json $translations
159 */
160 public function setTranslations(Json $translations)
161 {
162 $this->translations = $translations;
163 }
164
165 /**
166 * @return Color
167 */
168 public function getColor()
169 {
170 return $this->color;
171 }
172
173 /**
174 * @param Color $color
175 */
176 public function setColor(Color $color)
177 {
178 $this->color = $color;
179 }
180
181 /**
182 * @return Picture
183 */
184 public function getPicture()
185 {
186 return $this->picture;
187 }
188
189 /**
190 * @param Picture $picture
191 */
192 public function setPicture(Picture $picture)
193 {
194 $this->picture = $picture;
195 }
196
197 /**
198 * @return array
199 */
200 public function toArray()
201 {
202 return [
203 'id' => null !== $this->getId() ? $this->getId()->getValue() : null,
204 'status' => $this->getStatus()->getValue(),
205 'name' => $this->getName()->getValue(),
206 'serviceList' => $this->getServiceList() ? $this->getServiceList()->toArray() : [],
207 'position' => $this->getPosition()->getValue(),
208 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null,
209 'color' => null !== $this->getColor() ? $this->getColor()->getValue() : null,
210 'pictureFullPath' => null !== $this->getPicture() ? $this->getPicture()->getFullPath() : null,
211 'pictureThumbPath' => null !== $this->getPicture() ? $this->getPicture()->getThumbPath() : null,
212 ];
213 }
214 }
215