Notifier/src/Kreta/Notifier/Domain/Model/Inbox/User.php 1 location
|
@@ 118-127 (lines=10) @@
|
| 115 |
|
} |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
public static function reconstitute(EventStream $stream) : EventSourcedAggregateRoot |
| 119 |
|
{ |
| 120 |
|
$receiver = new self($stream->aggregateRootId()); |
| 121 |
|
$events = $stream->events()->toArray(); |
| 122 |
|
foreach ($events as $event) { |
| 123 |
|
$receiver->apply($event); |
| 124 |
|
} |
| 125 |
|
|
| 126 |
|
return $receiver; |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
|
SharedKernel/tests/Double/Domain/Model/AggregateRootStub.php 1 location
|
@@ 58-67 (lines=10) @@
|
| 55 |
|
$this->property = 'foo'; |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public static function reconstitute(EventStream $events) : EventSourcedAggregateRoot |
| 59 |
|
{ |
| 60 |
|
$instance = new self($events->aggregateRootId()); |
| 61 |
|
|
| 62 |
|
foreach ($events as $event) { |
| 63 |
|
$instance->apply($event); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
return $instance; |
| 67 |
|
} |
| 68 |
|
} |
| 69 |
|
|