class_name .= "Account"; $this->layout = LAYOUTS['admin']; $this->title = lang("{$this->class_name}.title"); helper($this->class_name); } final protected function getMyLibrary(): Account { if ($this->_myLibrary === null) { $this->_myLibrary = new Account(); } return $this->_myLibrary; } //Field별 Form Input용 protected function getFormFieldInput(string $field, string $value, array $inputs = []): array { switch ($field) { case 'type': $inputs[$field] = form_dropdown( $field, $this->getFormFieldInputOption($field), $value ); break; default: $inputs[$field] = parent::getFormFieldInput($field, $value, $inputs); break; } return $inputs; } protected function create_init(): void { $this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'status']; $this->filter_fields = ['type', 'status']; $this->action = DB_ACTION['CREATE']; $this->getMyLibrary()->getMyStorage()->setAction($this->action); } // public function create_form(): RedirectResponse|string // { // $this->create_init(); // return $this->create_form_process(); // } protected function create_process_submit(): void { $entity = $this->getMyLibrary()->create($this->formDatas); } public function create(): RedirectResponse { $this->create_init(); $this->formDatas = []; $this->getFormDatas(); $this->convertFormDatas(); $this->validateFormDatas(); return parent::create_process(); } protected function index_init(): void { $this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'oldkey', 'title', 'type', 'status', 'updated_at', 'created_at']; $this->filter_fields = ['type', 'status']; $this->action = DB_ACTION['CREATE']; $this->getMyLibrary()->getMyStorage()->setAction($this->action); helper(['form']); $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; } public function index(): string { $this->index_init(); return parent::list_process(); } }