| 1 | <?php |
||
| 12 | class DummyTaskWasExecuted implements Event |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var AggregateRootId |
||
| 16 | */ |
||
| 17 | private $aggregateRootId; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var PointInTime |
||
| 21 | */ |
||
| 22 | private $timeOfRecording; |
||
| 23 | |||
| 24 | public function __construct(AggregateRootId $aggregateRootId, PointInTime $timeOfRecording) |
||
| 25 | { |
||
| 26 | $this->aggregateRootId = $aggregateRootId; |
||
| 27 | $this->timeOfRecording = $timeOfRecording; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function aggregateRootId(): AggregateRootId |
||
| 31 | { |
||
| 32 | return $this->aggregateRootId; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function eventVersion(): int |
||
| 36 | { |
||
| 37 | return 1; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function timeOfRecording(): PointInTime |
||
| 41 | { |
||
| 42 | return $this->timeOfRecording; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function toPayload(): array |
||
| 46 | { |
||
| 47 | return []; |
||
| 48 | } |
||
| 49 | |||
| 50 | public static function fromPayload(array $payload, AggregateRootId $aggregateRootId, PointInTime $timeOfRecording): Event |
||
| 51 | { |
||
| 52 | return new DummyTaskWasExecuted($aggregateRootId, $timeOfRecording); |
||
| 53 | } |
||
| 54 | } |