public function applyGameLost(GameLost $event) { $readModel = $this->repository->find($event->getGameId()); $readModel->setStatus("Game lost!"); $readModel->setGameEndTime($event->getExpandedTimeOnGame()); $this->repository->save($readModel); }
/** * @param string $tag * * @return void */ public function decrement($category) { /** @var PostCategoryCount $postCategoryCount */ $postCategoryCount = $this->broadwayRepository->find($category); if ($postCategoryCount) { $postCategoryCount->setCount($postCategoryCount->getCount() - 1); } else { $postCategoryCount = new PostCategoryCount($category, 1); } $this->broadwayRepository->save($postCategoryCount); }
public function getGameWonAction($id) { $game = $this->readModelRepository->find($id); if (is_null($game)) { return $this->redirectToRoute("get_game", ["id" => $id]); } }
public function getGameStaticAction($id) { $readModel = $this->readModelRepository->find($id); if (null === $readModel) { return ["no-content found"]; } return json_encode(serialize($readModel)); }
/** * @param string $id * * @return PublishedPost */ public function find($id) { return $this->broadwayRepository->find($id); }