src/Domain/AggregateRoot/EventSourcedAggregateRoot.php
final public static function loadFromHistory(EventStream $eventStream)
    {
        $aggregate = new static();

        while ($eventStream->hasNext()) {
            $aggregate->replayChange($eventStream->next());
        }

        return $aggregate;
    }
final public static function loadFromHistory(EventStream $eventStream)
    {
        $aggregate = new static();

        while ($eventStream->hasNext()) {
            $aggregate->replayChange($eventStream->next());
        }

        return $aggregate;
    }
final public static function loadFromHistory ( EventStream $ eventStream ) { $ aggregate = new static ( ) ; while ( $ eventStream -> hasNext ( ) ) { $ aggregate -> replayChange ( $ eventStream -> next ( ) ) ; } return $ aggregate ; }
Roll-out all events to reconstitute the state of the aggregate.

@param EventStream $eventStream

@return static
Roll - out all events to reconstitute the state of the aggregate .