CustomerBookingEventPeriodFactory.php
6 months ago
CustomerBookingEventTicketFactory.php
6 months ago
EventFactory.php
2 weeks ago
EventPeriodFactory.php
6 months ago
EventTagFactory.php
6 months ago
EventTicketFactory.php
6 months ago
RecurringFactory.php
6 months ago
CustomerBookingEventPeriodFactory.php
44 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\Factory\Booking\Event; |
| 9 | |
| 10 | use AmeliaBooking\Domain\Entity\Booking\Event\CustomerBookingEventPeriod; |
| 11 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 12 | |
| 13 | /** |
| 14 | * Class CustomerBookingEventPeriodFactory |
| 15 | * |
| 16 | * @package AmeliaBooking\Domain\Factory\Booking\Event |
| 17 | */ |
| 18 | class CustomerBookingEventPeriodFactory |
| 19 | { |
| 20 | /** |
| 21 | * @param $data |
| 22 | * |
| 23 | * @return CustomerBookingEventPeriod |
| 24 | */ |
| 25 | public static function create($data) |
| 26 | { |
| 27 | $customerBookingEventPeriod = new CustomerBookingEventPeriod(); |
| 28 | |
| 29 | if (!empty($data['id'])) { |
| 30 | $customerBookingEventPeriod->setId(new Id($data['id'])); |
| 31 | } |
| 32 | |
| 33 | if (!empty($data['eventPeriodId'])) { |
| 34 | $customerBookingEventPeriod->setEventPeriodId(new Id($data['eventPeriodId'])); |
| 35 | } |
| 36 | |
| 37 | if (!empty($data['customerBookingId'])) { |
| 38 | $customerBookingEventPeriod->setCustomerBookingId(new Id($data['customerBookingId'])); |
| 39 | } |
| 40 | |
| 41 | return $customerBookingEventPeriod; |
| 42 | } |
| 43 | } |
| 44 |