ticket_comment_id); } private function getDirectory(): string { $subfolder = bcdiv($this->id, 1000); $folder = $_ENV["ROOT_DIR"] . "/files/ticket_attachments/$subfolder"; if(!file_exists($folder) && !mkdir($folder, 0777, true) && !is_dir($folder)) { throw new RuntimeException(sprintf('Directory "%s" was not created', $folder)); } return $folder; } public function getPath(): string { return $this->getDirectory() . "/" . $this->id; } public function renderButton(): void { ?> file_name)?>