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