/**
* @param EventStore $eventStore
* @param AggregateType $aggregateType
* @param AggregateTranslator $aggregateTranslator
* @param SnapshotStore|null $snapshotStore
* @param StreamName|null $streamName
* @param bool $oneStreamPerAggregate
*/
public function __construct(EventStore $eventStore, AggregateType $aggregateType, AggregateTranslator $aggregateTranslator, SnapshotStore $snapshotStore = null, StreamName $streamName = null, $oneStreamPerAggregate = false)
{
$this->eventStore = $eventStore;
$this->eventStore->getActionEventEmitter()->attachListener('commit.pre', [$this, 'addPendingEventsToStream']);
$this->aggregateType = $aggregateType;
$this->aggregateTranslator = $aggregateTranslator;
$this->snapshotStore = $snapshotStore;
$this->streamName = $streamName;
$this->oneStreamPerAggregate = $oneStreamPerAggregate;
}