function SaveChanges($id, $name, $seats, $description, $buttonPress) { $id = $id == "null" ? null : $id; $name = $name == "null" ? null : $name; $seats = $seats == "null" ? null : $seats; $description = $description == "null" ? null : $description; $buttonPress = $buttonPress == "null" ? null : $buttonPress; $plane = new Plane(); $plane->set($name, $seats, $description); $plane->Id = $id; $plane->mode = "edit"; $this->modelView->plane = $plane; $this->modelView->planeModel = new PlaneModel($plane); if ($this->modelView->plane->validated()) { $this->modelView->planeModel->Update(); } else { ContextManager::ValidationFor("warning", $this->modelView->plane->getError()); } $this->ViewBag("Title", "Save Changes"); $this->ViewBag("Controller", "Plane"); $this->ViewBag("Page", "Index"); return $this->View($this->modelView, "Account", "Index"); }