30 public function __construct($a_obj_id, $a_export_type =
'', $a_filename =
'')
32 $this->obj_id = $a_obj_id;
33 $this->export_type = $a_export_type;
34 $this->file_name = $a_filename;
53 $query =
"SELECT * FROM export_file_info " .
54 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
' ' .
55 "AND export_type = " .
$ilDB->quote(
$a_type,
'text') .
' ' .
56 "ORDER BY create_date DESC";
59 if (!$a_version
or $row->version == $a_version) {
78 $ilDB->manipulate(
"DELETE FROM export_file_info WHERE obj_id = " .
$ilDB->quote($a_obj_id));
110 $this->file_name = $a_name;
134 $this->obj_id = $a_id;
152 $this->version = $a_version;
180 $this->create_date = $dt;
190 $db = $DIC->database();
192 $exists_query =
'select * from export_file_info ' .
193 'where obj_id = ' . $db->quote($this->obj_id,
'integer') .
' ' .
194 'and export_type = ' . $db->quote($this->
getExportType(),
'text') .
' ' .
195 'and filename = ' . $db->quote($this->
getFilename(),
'text');
196 $exists_res = $db->query($exists_query);
198 if (!$exists_res->numRows()) {
199 $query =
"INSERT INTO export_file_info (obj_id, export_type, filename, version, create_date) " .
201 $db->quote($this->
getObjId(),
'integer') .
', ' .
204 $db->quote($this->
getVersion(),
'text') .
', ' .
215 public function delete()
219 $ilDB = $DIC[
'ilDB'];
222 'DELETE FROM export_file_info ' .
223 'WHERE obj_id = ' .
$ilDB->quote($this->getObjId(),
'integer') .
' ' .
224 'AND filename = ' .
$ilDB->quote($this->getFilename(),
'text')
237 $ilDB = $DIC[
'ilDB'];
239 $query =
"SELECT * FROM export_file_info " .
240 "WHERE obj_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
' ' .
setFilename($a_name)
set filename
getExportType()
get export type
getBasename($a_ext='.zip')
setObjId($a_id)
Set obj id.
__construct($a_obj_id, $a_export_type='', $a_filename='')
ilExportFileInfo constructor.
foreach($_POST as $key=> $value) $res
static deleteByObjId($a_obj_id)
Delete all export entries by obj_id.
static lookupLastExport($a_obj_id, $a_type, $a_version='')
Lookup last export.
Stores information of creation date and versions of export files
create()
Create new export entry.
setExportType($a_type)
set export type
getFilename()
get filename
getCreationDate()
get creation date
setCreationDate(ilDateTime $dt=null)
set creation date
setVersion($a_version)
set version