BlockTime.php
2 months ago
DayOff.php
2 months ago
Period.php
6 months ago
PeriodLocation.php
6 months ago
PeriodService.php
6 months ago
SpecialDay.php
6 months ago
SpecialDayPeriod.php
6 months ago
SpecialDayPeriodLocation.php
6 months ago
SpecialDayPeriodService.php
6 months ago
TimeOut.php
6 months ago
WeekDay.php
6 months ago
PeriodLocation.php
76 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\Schedule; |
| 9 | |
| 10 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 11 | |
| 12 | /** |
| 13 | * Class PeriodLocation |
| 14 | * |
| 15 | * @package AmeliaBooking\Domain\Entity\Schedule |
| 16 | */ |
| 17 | class PeriodLocation |
| 18 | { |
| 19 | /** @var Id */ |
| 20 | private $id; |
| 21 | |
| 22 | /** @var Id */ |
| 23 | private $locationId; |
| 24 | |
| 25 | /** |
| 26 | * PeriodLocation constructor. |
| 27 | * |
| 28 | * @param Id $locationId |
| 29 | */ |
| 30 | public function __construct( |
| 31 | Id $locationId |
| 32 | ) { |
| 33 | $this->locationId = $locationId; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * @return Id |
| 38 | */ |
| 39 | public function getId() |
| 40 | { |
| 41 | return $this->id; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @param Id $id |
| 46 | */ |
| 47 | public function setId(Id $id) |
| 48 | { |
| 49 | $this->id = $id; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @return Id |
| 54 | */ |
| 55 | public function getLocationId() |
| 56 | { |
| 57 | return $this->locationId; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @param Id $locationId |
| 62 | */ |
| 63 | public function setLocationId(Id $locationId) |
| 64 | { |
| 65 | $this->locationId = $locationId; |
| 66 | } |
| 67 | |
| 68 | public function toArray() |
| 69 | { |
| 70 | return [ |
| 71 | 'id' => null !== $this->getId() ? $this->getId()->getValue() : null, |
| 72 | 'locationId' => $this->locationId->getValue(), |
| 73 | ]; |
| 74 | } |
| 75 | } |
| 76 |