addClassName('MyLog'); } public function getModelClass(): MyLogModel { return new MyLogModel(); } public function getEntityClass(): MyLogEntity { return new MyLogEntity(); } public function getFormFields(): array { return [ "user_uid", "class_name", "method_name", "title", "content", "status", ]; } public function getFilterFields(): array { return ['user_uid', 'status']; } public function getBatchJobFields(): array { return ['status']; } public function getIndexFields(): array { return ['user_uid', 'class_name', 'method_name', 'title', 'status', 'created_at']; } public function getUserService(): UserService { if (!$this->_userService) { $this->_userService = new UserService(); } return $this->_userService; } //기본기능 //FieldForm관련용 public function getFormFieldOption(string $field, array $options = []): array { switch ($field) { case 'user_uid': $options = $this->getUserService()->getEntities(); break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } public function save(string $class, string $method, string $title, int $user_uid): MyLogEntity { $formDatas = [ 'user_uid' => $user_uid, 'class_name' => $class, 'method_name' => $method, 'title' => $title, 'content' => LogCollector::dump(), ]; LogCollector::clear(); return $this->create($formDatas); } //List 검색용 public function setList_WordFilter(string $word): void { $this->getModel()->orLike($this->getModel()::TABLE . "." . $this->getModel()::TITLE, $word, 'both'); $this->getModel()->orLike($this->getModel()::TABLE . '.content', $word, 'both'); } }