public function action_newModel() { $domain = SessionService::getInstance()->get('userName'); if (empty($this->post['name_model'])) { $this->msg = 'Model name must be filled in.'; return []; } if (modelsData::modelExists($domain, $this->post['name_model'])) { $this->msg = 'Sorry, this model already exists.'; return []; } if (modelsData::maxModelNumber($domain, self::$MAXMODELS)) { $this->msg = 'Over maximum number of models..'; return []; } if (!modelsData::createDomain($domain, $this->post['name_model'])) { $this->msg = 'Failed to create model.'; } if ($this->createConfigFile($domain, $this->post['name_model'])) { $this->delParamSession(); SessionService::getInstance()->set('modelName', $this->post['name_model']); } else { $this->msg = 'Failed to create model.'; } return []; }