| @@ 109-135 (lines=27) @@ | ||
| 106 | * @param \DateTimeImmutable|null $publicationDate |
|
| 107 | * @return Event |
|
| 108 | */ |
|
| 109 | public static function create( |
|
| 110 | $eventId, |
|
| 111 | Language $mainLanguage, |
|
| 112 | Title $title, |
|
| 113 | EventType $eventType, |
|
| 114 | Location $location, |
|
| 115 | CalendarInterface $calendar, |
|
| 116 | Theme $theme = null, |
|
| 117 | \DateTimeImmutable $publicationDate = null |
|
| 118 | ) { |
|
| 119 | $event = new self(); |
|
| 120 | ||
| 121 | $event->apply( |
|
| 122 | new EventCreated( |
|
| 123 | $eventId, |
|
| 124 | $mainLanguage, |
|
| 125 | $title, |
|
| 126 | $eventType, |
|
| 127 | $location, |
|
| 128 | $calendar, |
|
| 129 | $theme, |
|
| 130 | $publicationDate |
|
| 131 | ) |
|
| 132 | ); |
|
| 133 | ||
| 134 | return $event; |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * @param string $newEventId |
|
| @@ 109-132 (lines=24) @@ | ||
| 106 | * |
|
| 107 | * @return self |
|
| 108 | */ |
|
| 109 | public static function createPlace( |
|
| 110 | $id, |
|
| 111 | Language $mainLanguage, |
|
| 112 | Title $title, |
|
| 113 | EventType $eventType, |
|
| 114 | Address $address, |
|
| 115 | CalendarInterface $calendar, |
|
| 116 | Theme $theme = null, |
|
| 117 | DateTimeImmutable $publicationDate = null |
|
| 118 | ) { |
|
| 119 | $place = new self(); |
|
| 120 | $place->apply(new PlaceCreated( |
|
| 121 | $id, |
|
| 122 | $mainLanguage, |
|
| 123 | $title, |
|
| 124 | $eventType, |
|
| 125 | $address, |
|
| 126 | $calendar, |
|
| 127 | $theme, |
|
| 128 | $publicationDate |
|
| 129 | )); |
|
| 130 | ||
| 131 | return $place; |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * Apply the place created event. |
|