@@ 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 |
@@ 90-111 (lines=22) @@ | ||
87 | * |
|
88 | * @return self |
|
89 | */ |
|
90 | public static function createPlace( |
|
91 | $id, |
|
92 | Title $title, |
|
93 | EventType $eventType, |
|
94 | Address $address, |
|
95 | CalendarInterface $calendar, |
|
96 | Theme $theme = null, |
|
97 | DateTimeImmutable $publicationDate = null |
|
98 | ) { |
|
99 | $place = new self(); |
|
100 | $place->apply(new PlaceCreated( |
|
101 | $id, |
|
102 | $title, |
|
103 | $eventType, |
|
104 | $address, |
|
105 | $calendar, |
|
106 | $theme, |
|
107 | $publicationDate |
|
108 | )); |
|
109 | ||
110 | return $place; |
|
111 | } |
|
112 | ||
113 | /** |
|
114 | * Apply the place created event. |