/** * @param Game $game * @param $status */ public function changeGameStatus(Game $game, $status) { $this->container->get("logger")->debug(__METHOD__ . ' ' . $game->getId() . ' ' . $status); $game->setStatus($status); $this->container->get("event_dispatcher")->dispatch(GameEvents::CHANGE_STATUS_BEFORE, (new GameEvent())->setGame($game)); $this->saveEntity($game); $this->container->get("event_dispatcher")->dispatch(GameEvents::CHANGE_STATUS_AFTER, (new GameEvent())->setGame($game)); }