22 $this->obj_id = $a_obj_id;
23 $this->mode = $a_mode;
27 $this->
read($a_obj_id);
42 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
44 $mappings = $cwo->getMappings();
47 $new_collection =
new static($target_obj_id,
$this->mode);
48 foreach($this->items as $item)
50 if(!isset($mappings[$item]) or !$mappings[$item])
55 $new_collection->addEntry($mappings[$item]);
58 $ilLog->write(__METHOD__.
': cloned learning progress collection.');
77 $res = $ilDB->query(
"SELECT * FROM ut_lp_collections".
78 " WHERE obj_id = ".$ilDB->quote($this->obj_id,
"integer"));
94 public function delete()
98 $query =
"DELETE FROM ut_lp_collections".
99 " WHERE obj_id = ".$ilDB->quote($this->obj_id ,
"integer");
100 $ilDB->manipulate(
$query);
102 $query =
"DELETE FROM ut_lp_coll_manual".
103 " WHERE obj_id = ".$ilDB->quote($this->obj_id,
"integer");
104 $ilDB->manipulate(
$query);
107 $this->items = array();
123 if(is_array($this->items))
125 return (
bool)in_array($a_item_id, $this->items);
136 $query =
"INSERT INTO ut_lp_collections".
137 " (obj_id, lpmode, item_id)".
138 " VALUES (".$ilDB->quote($this->obj_id ,
"integer").
139 ", ".$ilDB->quote($this->mode,
"integer").
140 ", ".$ilDB->quote($a_item_id ,
"integer").
142 $ilDB->manipulate(
$query);
143 $this->items[] = $a_item_id;
152 $query =
"DELETE FROM ut_lp_collections".
153 " WHERE obj_id = ".$ilDB->quote($this->obj_id,
"integer").
154 " AND item_id = ".$ilDB->quote($a_item_id,
"integer");
155 $ilDB->manipulate(
$query);
161 foreach($a_item_ids as $item_id)
169 foreach($a_item_ids as $item_id)