ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilFileDataForum.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24  private array $posting_cache = [];
26 
27  public function __construct(
28  private readonly int $obj_id = 0,
29  private readonly int $pos_id = 0
30  ) {
31  $this->rc_implementation = new ilFileDataForumRCImplementation(
32  $this->obj_id,
33  $this->pos_id
34  );
35  }
36 
37  private function getCurrentPosting(): ilForumPost
38  {
39  return $this->posting_cache[$this->pos_id] ?? ($this->posting_cache[$this->pos_id] = new ilForumPost(
40  $this->pos_id
41  ));
42  }
43 
44  public function getObjId(): int
45  {
46  return $this->rc_implementation->getObjId();
47  }
48 
49  public function getPosId(): int
50  {
51  return $this->rc_implementation->getPosId();
52  }
53 
54  public function setPosId(int $posting_id): void
55  {
56  $this->rc_implementation->setPosId($posting_id);
57  }
58 
59  public function getForumPath(): string
60  {
61  return $this->rc_implementation->getForumPath();
62  }
63 
67  public function getFilesOfPost(): array
68  {
69  return $this->rc_implementation->getFilesOfPost();
70  }
71 
72  public function moveFilesOfPost(int $new_frm_id = 0): bool
73  {
74  return $this->rc_implementation->moveFilesOfPost($new_frm_id);
75  }
76 
77  public function ilClone(int $new_obj_id, int $new_posting_id): bool
78  {
79  return $this->rc_implementation->ilClone($new_obj_id, $new_posting_id);
80  }
81 
82  public function delete(?array $posting_ids_to_delete = null): bool
83  {
84  return $this->rc_implementation->delete($posting_ids_to_delete);
85  }
86 
87  public function storeUploadedFiles(): bool
88  {
89  return $this->rc_implementation->storeUploadedFiles();
90  }
91 
92  public function unlinkFile(string $filename): bool
93  {
94  return $this->rc_implementation->unlinkFile($filename);
95  }
96 
100  public function getFileDataByMD5Filename(string $hashed_filename): ?array
101  {
102  return $this->rc_implementation->getFileDataByMD5Filename($hashed_filename);
103  }
104 
108  public function unlinkFilesByMD5Filenames($hashed_filename_or_filenames): bool
109  {
110  return $this->rc_implementation->unlinkFilesByMD5Filenames($hashed_filename_or_filenames);
111  }
112 
113  public function deliverFile(string $file): void
114  {
115  $this->rc_implementation->deliverFile($file);
116  }
117 
118  public function deliverZipFile(): bool
119  {
120  return $this->rc_implementation->deliverZipFile();
121  }
122 
123  public function importPath(string $path_to_file, int $posting_id): void
124  {
125  // Importing is only possible for IRSS based files
126  $this->setPosId($posting_id);
127  $this->rc_implementation->importFileToCollection($path_to_file, $this->getCurrentPosting());
128  }
129 }
ilClone(int $new_obj_id, int $new_posting_id)
unlinkFilesByMD5Filenames($hashed_filename_or_filenames)
setPosId(int $posting_id)
unlinkFile(string $filename)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importPath(string $path_to_file, int $posting_id)
$filename
Definition: buildRTE.php:78
getFileDataByMD5Filename(string $hashed_filename)
readonly ilFileDataForumRCImplementation $rc_implementation
moveFilesOfPost(int $new_frm_id=0)
__construct(private readonly int $obj_id=0, private readonly int $pos_id=0)