class_name = "Account"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); helper($this->class_path); } final protected function getModel(): AccountModel { if ($this->_model === null) { $this->_model = new AccountModel(); } return $this->_model; } final protected function getMySocket(): AccountSocket { if ($this->_mySocket === null) { $this->_mySocket = new AccountSocket($this->_auth_key); } return $this->_mySocket; } protected function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case $this->getModel()::PARENT: // $this->getAuthModel()->where('status', DEFAULTS['STATUS']); $options[$field] = $this->getAuthModel()->getFormFieldOption($field); // echo $this->getAuthModel()->getLastQuery(); // dd($options); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } // 리스트 public function index(): string { $this->action = __FUNCTION__; $this->fields = [$this->getModel()::PARENT, $this->getModel()::TITLE, 'type', 'status', 'updated_at', 'created_at']; $this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields); $this->filter_fields = [$this->getModel()::PARENT, 'type', 'status']; $this->field_options = $this->getFormFieldOptions($this->filter_fields); $this->batchjob_fields = ['typep', 'status']; return $this->list_procedure(); } // Download public function download(string $output_type, $uid = false): DownloadResponse|string { $this->action = __FUNCTION__; $this->fields = [$this->getModel()::PARENT, $this->getModel()::TITLE, 'type', 'status', 'updated_at', 'created_at']; $this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields); $this->filter_fields = [$this->getModel()::PARENT, 'type', 'status']; $this->field_options = $this->getFormFieldOptions($this->filter_fields); $this->batchjob_fields = ['typep', 'status']; return $this->download_procedure($output_type, $uid); } //Zone Reload By Account protected function reload_process(): void { foreach ($this->getModel()->getEntitys as $entity) { $zone_socket = new ZoneSocket($entity); $zone_socket->reload(); } } public function reload(): RedirectResponse { return $this->reload_procedure(); } }