Location.php
315 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Domain\Entity\Location; |
| 4 | |
| 5 | use AmeliaBooking\Domain\Collection\Collection; |
| 6 | use AmeliaBooking\Domain\ValueObjects\Json; |
| 7 | use AmeliaBooking\Domain\ValueObjects\String\Status; |
| 8 | use AmeliaBooking\Domain\ValueObjects\Picture; |
| 9 | use AmeliaBooking\Domain\ValueObjects\String\Address; |
| 10 | use AmeliaBooking\Domain\ValueObjects\String\Description; |
| 11 | use AmeliaBooking\Domain\ValueObjects\GeoTag; |
| 12 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 13 | use AmeliaBooking\Domain\ValueObjects\String\Name; |
| 14 | use AmeliaBooking\Domain\ValueObjects\String\Phone; |
| 15 | use AmeliaBooking\Domain\ValueObjects\String\Url; |
| 16 | |
| 17 | /** |
| 18 | * Class Location |
| 19 | * |
| 20 | * @package AmeliaBooking\Domain\Entity\Location |
| 21 | */ |
| 22 | class Location |
| 23 | { |
| 24 | /** @var Id */ |
| 25 | private $id; |
| 26 | |
| 27 | /** @var Status */ |
| 28 | private $status; |
| 29 | |
| 30 | /** @var Name */ |
| 31 | private $name; |
| 32 | |
| 33 | /** @var Description */ |
| 34 | private $description; |
| 35 | |
| 36 | /** @var Address */ |
| 37 | private $address; |
| 38 | |
| 39 | /** @var Phone */ |
| 40 | private $phone; |
| 41 | |
| 42 | /** @var GeoTag */ |
| 43 | private $coordinates; |
| 44 | |
| 45 | /** @var Picture */ |
| 46 | private $picture; |
| 47 | |
| 48 | /** @var Url */ |
| 49 | private $pin; |
| 50 | |
| 51 | /** @var Json */ |
| 52 | protected $translations; |
| 53 | |
| 54 | /** @var Collection */ |
| 55 | private $serviceList; |
| 56 | |
| 57 | /** @var Collection */ |
| 58 | private $eventList; |
| 59 | |
| 60 | /** @var Collection */ |
| 61 | private $providerList; |
| 62 | |
| 63 | /** @var Name */ |
| 64 | private $countryPhoneIso; |
| 65 | |
| 66 | /** |
| 67 | * @return Id |
| 68 | */ |
| 69 | public function getId() |
| 70 | { |
| 71 | return $this->id; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * @param Id $id |
| 76 | */ |
| 77 | public function setId(Id $id) |
| 78 | { |
| 79 | $this->id = $id; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * @return Status |
| 84 | */ |
| 85 | public function getStatus() |
| 86 | { |
| 87 | return $this->status; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @param Status $status |
| 92 | */ |
| 93 | public function setStatus(Status $status) |
| 94 | { |
| 95 | $this->status = $status; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @return Name |
| 100 | */ |
| 101 | public function getName() |
| 102 | { |
| 103 | return $this->name; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * @param Name $name |
| 108 | */ |
| 109 | public function setName(Name $name) |
| 110 | { |
| 111 | $this->name = $name; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * @return Description |
| 116 | */ |
| 117 | public function getDescription() |
| 118 | { |
| 119 | return $this->description; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * @param Description $description |
| 124 | */ |
| 125 | public function setDescription(Description $description) |
| 126 | { |
| 127 | $this->description = $description; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * @return Address |
| 132 | */ |
| 133 | public function getAddress() |
| 134 | { |
| 135 | return $this->address; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * @param Address $address |
| 140 | */ |
| 141 | public function setAddress(Address $address) |
| 142 | { |
| 143 | $this->address = $address; |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * @return Phone |
| 148 | */ |
| 149 | public function getPhone() |
| 150 | { |
| 151 | return $this->phone; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * @param Phone $phone |
| 156 | */ |
| 157 | public function setPhone(Phone $phone) |
| 158 | { |
| 159 | $this->phone = $phone; |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * @return GeoTag |
| 164 | */ |
| 165 | public function getCoordinates() |
| 166 | { |
| 167 | return $this->coordinates; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * @param GeoTag $coordinates |
| 172 | */ |
| 173 | public function setCoordinates(GeoTag $coordinates) |
| 174 | { |
| 175 | $this->coordinates = $coordinates; |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * @return Picture |
| 180 | */ |
| 181 | public function getPicture() |
| 182 | { |
| 183 | return $this->picture; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * @param Picture $picture |
| 188 | */ |
| 189 | public function setPicture(Picture $picture) |
| 190 | { |
| 191 | $this->picture = $picture; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * @return Url |
| 196 | */ |
| 197 | public function getPin() |
| 198 | { |
| 199 | return $this->pin; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * @param Url $pin |
| 204 | */ |
| 205 | public function setPin(Url $pin) |
| 206 | { |
| 207 | $this->pin = $pin; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * @return Json |
| 212 | */ |
| 213 | public function getTranslations() |
| 214 | { |
| 215 | return $this->translations; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * @param Json $translations |
| 220 | */ |
| 221 | public function setTranslations(Json $translations) |
| 222 | { |
| 223 | $this->translations = $translations; |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * @return Collection |
| 228 | */ |
| 229 | public function getServiceList() |
| 230 | { |
| 231 | return $this->serviceList; |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * @param Collection $serviceList |
| 236 | */ |
| 237 | public function setServiceList($serviceList) |
| 238 | { |
| 239 | $this->serviceList = $serviceList; |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * @return Collection |
| 244 | */ |
| 245 | public function getEventList() |
| 246 | { |
| 247 | return $this->eventList; |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * @param Collection $eventList |
| 252 | */ |
| 253 | public function setEventList($eventList) |
| 254 | { |
| 255 | $this->eventList = $eventList; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * @return Collection |
| 260 | */ |
| 261 | public function getProviderList() |
| 262 | { |
| 263 | return $this->providerList; |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * @param Collection $providerList |
| 268 | */ |
| 269 | public function setProviderList($providerList) |
| 270 | { |
| 271 | $this->providerList = $providerList; |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * @return Name |
| 276 | */ |
| 277 | public function getCountryPhoneIso() |
| 278 | { |
| 279 | return $this->countryPhoneIso; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * @param Name $countryPhoneIso |
| 284 | */ |
| 285 | public function setCountryPhoneIso(Name $countryPhoneIso) |
| 286 | { |
| 287 | $this->countryPhoneIso = $countryPhoneIso; |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * @return array |
| 292 | */ |
| 293 | public function toArray() |
| 294 | { |
| 295 | return [ |
| 296 | 'id' => null !== $this->getId() ? $this->getId()->getValue() : null, |
| 297 | 'status' => null !== $this->getStatus() ? $this->getStatus()->getValue() : null, |
| 298 | 'name' => $this->getName() ? $this->getName()->getValue() : '', |
| 299 | 'description' => null !== $this->getDescription() ? $this->getDescription()->getValue() : null, |
| 300 | 'address' => $this->getAddress() ? $this->getAddress()->getValue() : null, |
| 301 | 'phone' => $this->getPhone() ? $this->getPhone()->getValue() : null, |
| 302 | 'latitude' => $this->getCoordinates() ? $this->getCoordinates()->getLatitude() : null, |
| 303 | 'longitude' => $this->getCoordinates() ? $this->getCoordinates()->getLongitude() : null, |
| 304 | 'pictureFullPath' => null !== $this->getPicture() ? $this->getPicture()->getFullPath() : null, |
| 305 | 'pictureThumbPath' => null !== $this->getPicture() ? $this->getPicture()->getThumbPath() : null, |
| 306 | 'pin' => null !== $this->getPin() ? $this->getPin()->getValue() : null, |
| 307 | 'translations' => $this->getTranslations() ? $this->getTranslations()->getValue() : null, |
| 308 | 'serviceList' => $this->getServiceList() ? $this->getServiceList()->toArray() : [], |
| 309 | 'eventList' => $this->getEventList() ? $this->getEventList()->toArray() : [], |
| 310 | 'providerList' => $this->getProviderList() ? $this->getProviderList()->toArray() : [], |
| 311 | 'countryPhoneIso' => null !== $this->getCountryPhoneIso() ? $this->getCountryPhoneIso()->getValue() : null, |
| 312 | ]; |
| 313 | } |
| 314 | } |
| 315 |