| @@ 86-110 (lines=25) @@ | ||
| 83 | * @param \DateTimeImmutable|null $publicationDate |
|
| 84 | * @return Event |
|
| 85 | */ |
|
| 86 | public static function create( |
|
| 87 | $eventId, |
|
| 88 | Title $title, |
|
| 89 | EventType $eventType, |
|
| 90 | Location $location, |
|
| 91 | CalendarInterface $calendar, |
|
| 92 | Theme $theme = null, |
|
| 93 | \DateTimeImmutable $publicationDate = null |
|
| 94 | ) { |
|
| 95 | $event = new self(); |
|
| 96 | ||
| 97 | $event->apply( |
|
| 98 | new EventCreated( |
|
| 99 | $eventId, |
|
| 100 | $title, |
|
| 101 | $eventType, |
|
| 102 | $location, |
|
| 103 | $calendar, |
|
| 104 | $theme, |
|
| 105 | $publicationDate |
|
| 106 | ) |
|
| 107 | ); |
|
| 108 | ||
| 109 | return $event; |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @param string $newEventId |
|
| @@ 89-110 (lines=22) @@ | ||
| 86 | * |
|
| 87 | * @return self |
|
| 88 | */ |
|
| 89 | public static function createPlace( |
|
| 90 | $id, |
|
| 91 | Title $title, |
|
| 92 | EventType $eventType, |
|
| 93 | Address $address, |
|
| 94 | CalendarInterface $calendar, |
|
| 95 | Theme $theme = null, |
|
| 96 | DateTimeImmutable $publicationDate = null |
|
| 97 | ) { |
|
| 98 | $place = new self(); |
|
| 99 | $place->apply(new PlaceCreated( |
|
| 100 | $id, |
|
| 101 | $title, |
|
| 102 | $eventType, |
|
| 103 | $address, |
|
| 104 | $calendar, |
|
| 105 | $theme, |
|
| 106 | $publicationDate |
|
| 107 | )); |
|
| 108 | ||
| 109 | return $place; |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * Apply the place created event. |
|