_user === null) { throw new \Exception("사용자정보가 없습니다."); } return $this->_user; } public function setUser(UserEntity $user): void { $this->_user = $user; } public function getBoardName(): string { if ($this->_boardName === null) { throw new \Exception("BoardModel이 지정되지 않았습니다."); } return $this->_boardName; } public function setBoardName(string $boardName): void { $this->_boardName = $boardName; } public function getModel(): FileModel { if ($this->_model === null) { return $this->_model = new FileModel(); } return $this->_model; } //망보드 파일관리 table에 등록 public function createFile($content): bool { if (!parent::save($content)) { return false; } //mb_files 모델작업 $entity = new FileEntity(); $entity->setTitle($this->getFileName()); $entity->user_pid = $this->getUser()->getPK(); $entity->user_name = $this->getUser()->getTitle(); $entity->board_name = $this->getBoardName(); $entity->table_name = "mb_" . $this->getBoardName(); $entity->file_path = $this->getPath(); $entity->file_type = $this->getMimeType(); $entity->reg_date = date("Y-m-d H:i:s"); return true; } }