Ejemplo n.º 1
0
 /**
  * @param WrongLetterGuessed $event
  */
 public function applyWrongLetterGuessed(WrongLetterGuessed $event)
 {
     $readModel = $this->repository->findBy(["gameId" => $event->getGameId()]);
     $lastResult = end($readModel);
     $readModel = $lastResult->setLetterWrongGuessed($event->getLetter());
     $this->repository->save($readModel);
 }
Ejemplo n.º 2
0
 /**
  * @param WrongLetterGuessed $event
  */
 public function applyWrongLetterGuessed(WrongLetterGuessed $event)
 {
     $readModel = new LetterChosen();
     $readModel->setGameId($event->getGameId());
     $readModel->setLetter($event->getLetter());
     $readModel->setMisGuessed(true);
     $this->repository->save($readModel);
 }