Prooph\EventStore\Aggregate\AggregateTranslator::extractPendingStreamEvents PHP 메소드

extractPendingStreamEvents() 공개 메소드

public extractPendingStreamEvents ( object $eventSourcedAggregateRoot ) : Prooph\Common\Messaging\Message[]
$eventSourcedAggregateRoot object
리턴 Prooph\Common\Messaging\Message[]
    public function extractPendingStreamEvents($eventSourcedAggregateRoot);

Usage Example

예제 #1
0
 /**
  * @param object $eventSourcedAggregateRoot
  * @throws Exception\AggregateTypeException
  */
 public function addAggregateRoot($eventSourcedAggregateRoot)
 {
     if (!is_object($eventSourcedAggregateRoot)) {
         throw new AggregateTypeException(sprintf('Invalid aggregate given. Aggregates need to be of type object but type of %s given', gettype($eventSourcedAggregateRoot)));
     }
     $aggregateId = $this->aggregateTranslator->extractAggregateId($eventSourcedAggregateRoot);
     $domainEvents = $this->aggregateTranslator->extractPendingStreamEvents($eventSourcedAggregateRoot);
     $this->streamStrategy->addEventsForNewAggregateRoot($this->aggregateType, $aggregateId, $domainEvents, $eventSourcedAggregateRoot);
     $this->identityMap[$aggregateId] = $eventSourcedAggregateRoot;
 }
All Usage Examples Of Prooph\EventStore\Aggregate\AggregateTranslator::extractPendingStreamEvents