public function save() { if (UserSession::getInstance()->getAccessLevel() < 3) { die("<h1>Forbidden resource for you.</h1>"); } $model = new Problem(); $model->setFields($this->params); $modelId = $model->get("prb_id"); if (!isset($modelId)) { $status = $this->saveNew($model); return $status; } else { $status = $this->update($model); return $status; } }