model = $model; } private function openEditor(TacticInfo $tactic): HttpResponse { return ViewHttpResponse::react("views/Editor.tsx", ["name" => $tactic->getName(), "id" => $tactic->getId()]); } public function makeNew(): HttpResponse { $tactic = $this->model->makeNewDefault(); return $this->openEditor($tactic); } /** * returns an editor view for a given tactic * @param int $id the targeted tactic identifier * @return HttpResponse */ public function openEditorFor(int $id): HttpResponse { $tactic = $this->model->get($id); if ($tactic == null) { return new JsonHttpResponse("la tactique " . $id . " n'existe pas", HttpCodes::NOT_FOUND); } return $this->openEditor($tactic); } }