private function prepareEventStream($entity, $id, $maxVersion)
 {
     $stream = new EventStream();
     for ($version = 1; $version <= $maxVersion; $version++) {
         $message = new EventMessage(new EventDouble($id), new EntityDTO($entity, $id, $version), EventEnvelope::now());
         $stream->recordThat($message);
     }
     return $stream;
 }
示例#2
0
 public static function record(Event $event, EntityDTO $entity)
 {
     return new static($event, $entity, EventEnvelope::now());
 }