19 declare(strict_types=1);
45 $rid = $this->irss->createContainer(
49 $this->db->insert(
'export_files_html', [
50 'object_id' => [
'integer', $object_id],
51 'rid' => [
'text', $rid],
53 'type' => [
'text', $type]
63 $this->irss->addStringToContainer(
75 $this->irss->addLocalFileToContainer(
85 string $target_path =
"" 88 $this->irss->addDirectoryToContainer(
96 string $source_container_id,
97 string $target_container_id,
98 string $source_dir_path =
"",
99 string $target_dir_path =
"" 101 $this->irss->addContainerDirToTargetContainer(
102 $source_container_id,
103 $target_container_id,
111 $this->db->update(
'export_files_html', [
113 'type' => [
'text', $file->
getType()]
116 'rid' => [
'text', $file->
getRid()]
120 public function delete(
125 $this->irss->deleteResource(
129 $this->db->manipulateF(
130 'DELETE FROM export_files_html WHERE object_id = %s AND rid = %s',
140 return $this->irss->getResourcePath($rid);
145 $set = $this->db->queryF(
146 'SELECT * FROM export_files_html WHERE object_id = %s AND rid = %s',
151 $record = $this->db->fetchAssoc($set);
160 $set = $this->db->queryF(
"SELECT * FROM export_files_html " .
161 " WHERE object_id = %s ORDER BY timestamp DESC",
165 while ($record = $this->db->fetchAssoc($set)) {
172 $set = $this->db->queryF(
"SELECT * FROM export_files_html " .
173 " WHERE object_id = %s AND type = %s ORDER BY timestamp DESC",
177 if ($record = $this->db->fetchAssoc($set)) {
185 return $this->irss->getResourceIdForIdString($rid);
190 return $this->data->exportFile(
191 (
int) $record[
'object_id'],
192 (
string) $record[
'rid'],
193 (
string) $record[
'timestamp'],
194 (
string) $record[
'type']
200 $this->irss->deliverFile($rid);
209 $this->irss->renameContainer($rid, $title);
getLatestOfObjectIdAndType(int $object_id, string $type="")
addFile(string $rid, string $fullpath, string $path,)
getAllOfObjectId(int $object_id)
addDirectory(string $rid, string $source_dir, string $target_path="")
getById(int $object_id, string $rid)
__construct(protected ilDBInterface $db, protected IRSSWrapper $irss, protected DataService $data, protected \ilExportHTMLStakeholder $stakeholder)
create(int $object_id, string $type, string $title)
static now()
Return current timestamp in Y-m-d H:i:s format.
addContainerDirToTargetContainer(string $source_container_id, string $target_container_id, string $source_dir_path="", string $target_dir_path="")
rename(string $rid, string $title)
getResourceIdForIdString(string $rid)
Class ResourceIdentification.
getExportFileFromRecord(array $record)
addString(string $rid, string $content, string $path,)