/**
  * @param AggregateRoot $aggregateRoot
  * @param int $expectedPlayHead
  * @return void
  * @throws ConcurrencyException
  */
 public function store(AggregateRoot $aggregateRoot, int $expectedPlayHead = -1)
 {
     $this->eventStore->save($aggregateRoot->getId(), $this->factory->getAggregateType(), $aggregateRoot->getUncommittedChanges(), $expectedPlayHead);
     $aggregateRoot->markChangesCommitted();
 }
Example #2
0
 /**
  * @param AggregateRoot $aggregate
  */
 public function replayEventsByAggregate(AggregateRoot $aggregate)
 {
     $this->replayEventsByAggregateId($aggregate->getId());
 }