/** * @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(); }
/** * @param AggregateRoot $aggregate */ public function replayEventsByAggregate(AggregateRoot $aggregate) { $this->replayEventsByAggregateId($aggregate->getId()); }