Esempio n. 1
0
 /**
  * @param EventStream $historyEvents
  * @return static
  */
 public static function reconstituteFromHistory(EventStream $historyEvents)
 {
     $instance = new static();
     $instance->replay($historyEvents);
     return $instance;
 }
Esempio n. 2
0
 /**
  * @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;
 }