Prooph\EventStore\Aggregate\AggregateRepository::__construct PHP Метод

__construct() публичный Метод

public __construct ( EventStore $eventStore, AggregateType $aggregateType, Prooph\EventStore\Aggregate\AggregateTranslator $aggregateTranslator, SnapshotStore $snapshotStore = null, StreamName $streamName = null, boolean $oneStreamPerAggregate = false )
$eventStore Prooph\EventStore\EventStore
$aggregateType AggregateType
$aggregateTranslator Prooph\EventStore\Aggregate\AggregateTranslator
$snapshotStore Prooph\EventStore\Snapshot\SnapshotStore
$streamName Prooph\EventStore\Stream\StreamName
$oneStreamPerAggregate boolean
    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;
    }

Usage Example

Пример #1
0
 /**
  * @param EventStore $eventStore
  */
 public function __construct(EventStore $eventStore)
 {
     $aggregateType = AggregateType::fromAggregateRootClass('Prooph\\Processing\\Processor\\Process');
     parent::__construct($eventStore, new AggregateTranslator(), new SingleStreamStrategy($eventStore, 'prooph_processing_stream'), $aggregateType);
 }
All Usage Examples Of Prooph\EventStore\Aggregate\AggregateRepository::__construct