DayOffFactory.php
5 years ago
PeriodFactory.php
2 years ago
PeriodLocationFactory.php
3 years ago
PeriodServiceFactory.php
7 years ago
SpecialDayFactory.php
7 years ago
SpecialDayPeriodFactory.php
2 years ago
SpecialDayPeriodLocationFactory.php
3 years ago
SpecialDayPeriodServiceFactory.php
7 years ago
TimeOutFactory.php
7 years ago
WeekDayFactory.php
7 years ago
PeriodServiceFactory.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Domain\Factory\Schedule; |
| 4 | |
| 5 | use AmeliaBooking\Domain\Entity\Schedule\PeriodService; |
| 6 | use AmeliaBooking\Domain\ValueObjects\Number\Integer\Id; |
| 7 | |
| 8 | class PeriodServiceFactory |
| 9 | { |
| 10 | /** |
| 11 | * @param array $data |
| 12 | * |
| 13 | * @return PeriodService |
| 14 | */ |
| 15 | public static function create($data) |
| 16 | { |
| 17 | $periodService = new PeriodService( |
| 18 | new Id($data['serviceId']) |
| 19 | ); |
| 20 | |
| 21 | if (isset($data['id'])) { |
| 22 | $periodService->setId(new Id($data['id'])); |
| 23 | } |
| 24 | |
| 25 | return $periodService; |
| 26 | } |
| 27 | } |
| 28 |