36 $this->export_id = $a_export_id;
46 if (self::$instance) {
47 return self::$instance;
72 $query =
'SELECT MAX(export_id) exp FROM export_options ' .
73 'GROUP BY export_id ';
77 $exp_id =
$row->exp + 1;
79 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value) ' .
81 $ilDB->quote($exp_id,
'integer') .
', ' .
82 $ilDB->quote(self::KEY_INIT,
'integer') .
', ' .
83 $ilDB->quote(0,
'integer') .
', ' .
84 $ilDB->quote(0,
'integer') .
', ' .
85 $ilDB->quote(0,
'integer') .
' ' .
101 foreach ((array) $this->ref_options[self::KEY_ITEM_MODE] as $ref_id => $mode) {
102 if ($mode == self::EXPORT_BUILD) {
116 foreach ((array) $this->ref_options[self::KEY_ITEM_MODE] as $ref_id => $mode) {
117 if ($mode != self::EXPORT_OMIT) {
133 public function addOption($a_keyword, $a_ref_id, $a_obj_id, $a_value)
137 $ilDB = $DIC[
'ilDB'];
139 $query =
"SELECT MAX(pos) position FROM export_options";
144 $pos =
$row->position;
148 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value,pos) ' .
151 $ilDB->quote($a_keyword,
'integer') .
', ' .
152 $ilDB->quote($a_ref_id,
'integer') .
', ' .
153 $ilDB->quote($a_obj_id,
'integer') .
', ' .
154 $ilDB->quote($a_value,
'integer') .
', ' .
155 $ilDB->quote($pos,
'integer') .
' ' .
167 return isset($this->options[$a_keyword]) ? $this->options[$a_keyword] : null;
178 return isset($this->obj_options[$a_keyword][$a_obj_id]) ? $this->obj_options[$a_keyword][$a_obj_id] : null;
189 return isset($this->ref_options[$a_keyword][$a_ref_id]) ? $this->ref_options[$a_keyword][$a_ref_id] : null;
196 public function delete()
200 $ilDB = $DIC[
'ilDB'];
202 $query =
"DELETE FROM export_options " .
216 $ilDB = $DIC[
'ilDB'];
218 $this->options = array();
219 $this->obj_options = array();
220 $this->ref_options = array();
222 $query =
"SELECT * FROM export_options " .
223 "WHERE export_id = " .
$ilDB->quote($this->
getExportId(),
'integer') .
' ' .
228 $this->ref_options[
$row->keyword][
$row->ref_id] =
$row->value;
231 $this->obj_options[
$row->keyword][
$row->obj_id] =
$row->value;
234 $this->options[
$row->keyword] =
$row->value;
getExportId()
Get export id.
static getInstance()
Get singelton instance.
getOptionByRefId($a_ref_id, $a_keyword)
Get option by.
getSubitemsForExport()
Get all subitems with mode != self::EXPORT_OMIT.
static newInstance($a_export_id)
Create new instance.
getOptionByObjId($a_obj_id, $a_keyword)
Get option by.
foreach($_POST as $key=> $value) $res
getSubitemsForCreation($a_source_id)
Get all subitems with mode ilExportOptions::EXPORT_BUILD
addOption($a_keyword, $a_ref_id, $a_obj_id, $a_value)
__construct($a_export_id)
Singleton constructor.
getOption($a_keyword)
Get option.
static allocateExportId()
Allocate a new export id.