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; }
public static function record(Event $event, EntityDTO $entity) { return new static($event, $entity, EventEnvelope::now()); }