| @@ 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. |
|
| @@ 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 |
|