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