ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilFileDataForumDrafts.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24  private array $draft_cache = [];
27 
28  public function __construct(
29  private readonly int $obj_id = 0,
30  private readonly int $draft_id = 0
31  ) {
32  $this->legacy_implementation = new ilFileDataForumDraftsLegacyImplementation(
33  $this->obj_id,
34  $this->draft_id
35  );
36  $this->rc_implementation = new ilFileDataForumDraftsRCImplementation(
37  $this->obj_id,
38  $this->draft_id
39  );
40  }
41 
42  private function getCurrentDraft(): ilForumPostDraft
43  {
44  if (isset($this->draft_cache[$this->draft_id])) {
45  return $this->draft_cache[$this->draft_id];
46  }
47 
48  return $this->draft_cache[$this->draft_id] = ilForumPostDraft::newInstanceByDraftId($this->draft_id);
49  }
50 
52  {
53  $draft = $this->getCurrentDraft();
54  if ($draft->getRCID() !== ilForumPost::NO_RCID) {
56  }
57 
59  }
60 
61  public function getObjId(): int
62  {
63  return $this->getImplementation()->getObjId();
64  }
65 
66  public function getPosId(): int
67  {
68  return $this->getImplementation()->getPosId();
69  }
70 
71  public function setPosId(int $posting_id): void
72  {
73  throw new DomainException('Not implemented');
74  }
75 
76  public function getForumPath(): string
77  {
78  return $this->getImplementation()->getForumPath();
79  }
80 
84  public function getFilesOfPost(): array
85  {
86  return $this->getImplementation()->getFilesOfPost();
87  }
88 
89  public function moveFilesOfPost(int $new_frm_id = 0): bool
90  {
91  return $this->getImplementation()->moveFilesOfPost($new_frm_id);
92  }
93 
94  public function ilClone(int $new_obj_id, int $new_posting_id): bool
95  {
96  return $this->getImplementation()->ilClone($new_obj_id, $new_posting_id);
97  }
98 
99  public function delete(array $posting_ids_to_delete = null): bool
100  {
101  return $this->getImplementation()->delete($posting_ids_to_delete);
102  }
103 
104  public function storeUploadedFiles(): bool
105  {
106  return $this->rc_implementation->storeUploadedFiles();
107  }
108 
109  public function unlinkFile(string $filename): bool
110  {
111  return $this->getImplementation()->unlinkFile($filename);
112  }
113 
117  public function getFileDataByMD5Filename(string $hashed_filename): ?array
118  {
119  return $this->getImplementation()->getFileDataByMD5Filename($hashed_filename);
120  }
121 
125  public function unlinkFilesByMD5Filenames($hashed_filename_or_filenames): bool
126  {
127  return $this->getImplementation()->unlinkFilesByMD5Filenames($hashed_filename_or_filenames);
128  }
129 
130  public function deliverFile(string $file): void
131  {
132  $this->getImplementation()->deliverFile($file);
133  }
134 
135  public function deliverZipFile(): bool
136  {
137  return $this->getImplementation()->deliverZipFile();
138  }
139 }
Class ilForumPostDraft.
getFileDataByMD5Filename(string $hashed_filename)
ilClone(int $new_obj_id, int $new_posting_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilFileDataForumDraftsRCImplementation $rc_implementation
unlinkFilesByMD5Filenames($hashed_filename_or_filenames)
$filename
Definition: buildRTE.php:78
ilFileDataForumDraftsLegacyImplementation $legacy_implementation
__construct(private readonly int $obj_id=0, private readonly int $draft_id=0)
static newInstanceByDraftId(int $draft_id)