title = lang("{$this->getService()->class_path}.title"); $this->helper = new AuthHelper(); } protected function getModel(): AuthModel { if ($this->_model === null) { $this->_model = new AuthModel(); } return $this->_model; } protected function getService(): AuthService { if ($this->service === null) { $this->service = new AuthService(); } return $this->service; } private function init(string $action, array $fields = []): void { $this->action = $action; $this->fields = count($fields) ? $fields : [$this->getModel()::TITLE, 'authkey', 'status', 'updated_at', 'created_at']; $this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields); $this->filter_fields = ['status']; $this->field_options = $this->getFormFieldOptions($this->filter_fields); $this->batchjob_fields = ['status']; } //생성 public function create_form(): RedirectResponse|string { $this->init('create', [$this->getModel()::TITLE, 'authkey', 'status']); return $this->create_form_procedure(); } public function create(): RedirectResponse|string { $this->init(__FUNCTION__, [$this->getModel()::TITLE, 'authkey', 'status']); return $this->create_procedure(); } //수정 public function modify_form(int $uid): RedirectResponse|string { $this->init('modify', [$this->getModel()::TITLE, 'authkey', 'status']); return $this->modify_form_procedure($uid); } public function modify(int $uid): RedirectResponse|string { $this->init(__FUNCTION__, [$this->getModel()::TITLE, 'authkey', 'status']); return $this->modify_procedure($uid); } //일괄처리작업 public function batcjob(): RedirectResponse { $this->init(__FUNCTION__); return $this->batcjob_procedure(); } //View public function view(int $uid): RedirectResponse|string { $this->init(__FUNCTION__); return $this->view_procedure($uid); } // 리스트 public function index(): string { $this->init(__FUNCTION__); return $this->list_procedure(); } // Download public function download(string $output_type, mixed $uid = false): DownloadResponse|string { $this->init(__FUNCTION__); return $this->download_procedure($output_type, $uid); } }