| @@ 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. |
|
| @@ 95-119 (lines=25) @@ | ||
| 92 | * @param \DateTimeImmutable|null $publicationDate |
|
| 93 | * @return Event |
|
| 94 | */ |
|
| 95 | public static function create( |
|
| 96 | $eventId, |
|
| 97 | Title $title, |
|
| 98 | EventType $eventType, |
|
| 99 | Location $location, |
|
| 100 | CalendarInterface $calendar, |
|
| 101 | Theme $theme = null, |
|
| 102 | \DateTimeImmutable $publicationDate = null |
|
| 103 | ) { |
|
| 104 | $event = new self(); |
|
| 105 | ||
| 106 | $event->apply( |
|
| 107 | new EventCreated( |
|
| 108 | $eventId, |
|
| 109 | $title, |
|
| 110 | $eventType, |
|
| 111 | $location, |
|
| 112 | $calendar, |
|
| 113 | $theme, |
|
| 114 | $publicationDate |
|
| 115 | ) |
|
| 116 | ); |
|
| 117 | ||
| 118 | return $event; |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * @param string $newEventId |
|