title = lang("{$this->getService()->getClassPath()}.title"); $this->helper = new UserSNSHelper(); } protected function getService(): UserSNSService { if ($this->service === null) { $this->service = new UserSNSService(); $this->class_name = $this->service->getClassName(); $this->class_path = $this->service->getClassPath(); } return $this->service; } protected function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case $this->getService()->getModel()::PARENT: $userModel = model(UserModel::class); // $this->getUserModel()->where('status', DEFAULTS['STATUS']); $options[$field] = $userModel->getFormFieldOption($field); // echo $this->getUserModel()->getLastQuery(); // dd($options); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } //생성 protected function create_init(string $action, $fields = []): void { $fields = [ 'fields' => [$this->getService()->getModel()::PARENT, 'site', 'id', $this->getService()->getModel()::TITLE, 'email'], ]; parent::create_init($action, fields: $fields); } //수정 protected function modify_init(string $action, $fields = []): void { $fields = [ 'fields' => [$this->getService()->getModel()::PARENT, 'site', 'id', $this->getService()->getModel()::TITLE, 'email', 'status'], ]; parent::modify_init($action, $fields); } }