/** * @param EventStream $historyEvents * @return static */ public static function reconstituteFromHistory(EventStream $historyEvents) { $instance = new static(); $instance->replay($historyEvents); return $instance; }
/** * @param \Iterator $historyEvents * * @throws \RuntimeException * * @return static */ protected static function reconstituteFromHistory(\Iterator $historyEvents) { $instance = new static(); $instance->replay($historyEvents); return $instance; }
/** * {@inheritdoc} */ public static function build(DomainEventStreamInterface $stream) { $aggregate = new static(); $aggregate->replay($stream); return $aggregate; }