CustomerBookingEventPeriod.php
6 months ago
CustomerBookingEventTicket.php
6 months ago
Event.php
3 months ago
EventPeriod.php
6 months ago
EventTag.php
2 months ago
EventTicket.php
6 months ago
CustomerBookingEventTicket.php
130 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\Booking\Event; |
| 9 | |
| 10 | use AmeliaBooking\Domain\ValueObjects\Number\Float\Price; |
| 11 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 12 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\IntegerValue; |
| 13 | |
| 14 | /** |
| 15 | * Class CustomerBookingEventTicket |
| 16 | * |
| 17 | * @package AmeliaBooking\Domain\Entity\Booking\Event |
| 18 | */ |
| 19 | class CustomerBookingEventTicket |
| 20 | { |
| 21 | /** @var Id */ |
| 22 | private $id; |
| 23 | |
| 24 | /** @var Id */ |
| 25 | private $customerBookingId; |
| 26 | |
| 27 | /** @var Id */ |
| 28 | protected $eventTicketId; |
| 29 | |
| 30 | /** @var IntegerValue */ |
| 31 | protected $persons; |
| 32 | |
| 33 | /** @var Price */ |
| 34 | protected $price; |
| 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) |
| 48 | { |
| 49 | $this->id = $id; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @return Id |
| 54 | */ |
| 55 | public function getCustomerBookingId() |
| 56 | { |
| 57 | return $this->customerBookingId; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @param Id $customerBookingId |
| 62 | */ |
| 63 | public function setCustomerBookingId(Id $customerBookingId) |
| 64 | { |
| 65 | $this->customerBookingId = $customerBookingId; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @return Id |
| 70 | */ |
| 71 | public function getEventTicketId() |
| 72 | { |
| 73 | return $this->eventTicketId; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * @param Id $eventTicketId |
| 78 | */ |
| 79 | public function setEventTicketId(Id $eventTicketId) |
| 80 | { |
| 81 | $this->eventTicketId = $eventTicketId; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @return IntegerValue |
| 86 | */ |
| 87 | public function getPersons() |
| 88 | { |
| 89 | return $this->persons; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @param IntegerValue $persons |
| 94 | */ |
| 95 | public function setPersons(IntegerValue $persons) |
| 96 | { |
| 97 | $this->persons = $persons; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * @return Price |
| 102 | */ |
| 103 | public function getPrice() |
| 104 | { |
| 105 | return $this->price; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * @param Price $price |
| 110 | */ |
| 111 | public function setPrice(Price $price) |
| 112 | { |
| 113 | $this->price = $price; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * @return array |
| 118 | */ |
| 119 | public function toArray() |
| 120 | { |
| 121 | return [ |
| 122 | 'id' => $this->getId() ? $this->getId()->getValue() : null, |
| 123 | 'eventTicketId' => $this->getEventTicketId() ? $this->getEventTicketId()->getValue() : null, |
| 124 | 'customerBookingId' => $this->getCustomerBookingId() ? $this->getCustomerBookingId()->getValue() : null, |
| 125 | 'persons' => $this->getPersons() ? $this->getPersons()->getValue() : null, |
| 126 | 'price' => $this->getPrice() ? $this->getPrice()->getValue() : null |
| 127 | ]; |
| 128 | } |
| 129 | } |
| 130 |