Пример #1
0
 public function save(User $user)
 {
     $this->eventStore->store($user->identifier(), $user->stagedEvents());
 }
Пример #2
0
 /**
  * @param EventSourcedEntity $eventSourcedEntity
  *
  * @throws \Exception
  */
 public function save(EventSourcedEntity $eventSourcedEntity)
 {
     $this->enforceTypeConstraint(get_class($eventSourcedEntity));
     $this->enforceVersionMismatchConstraint($eventSourcedEntity);
     $this->eventStore->store($eventSourcedEntity);
 }