19 declare(strict_types=0);
38 $this->db = $DIC->database();
39 $this->
logger = $DIC->logger()->trac();
41 $this->obj_id = $a_obj_id;
42 $this->mode = $a_mode;
45 $this->
read($a_obj_id);
53 $path =
"components/ILIAS/Tracking/classes/collection/";
105 $mappings = $cwo->getMappings();
108 $new_collection =
new static($target_obj_id,
$this->mode);
109 foreach ($this->items as $item) {
110 if (!isset($mappings[$item]) or !$mappings[$item]) {
114 $new_collection->addEntry($mappings[$item]);
116 $this->
logger->debug(
'cloned learning progress collection.');
124 protected function read(
int $a_obj_id): void
127 $res = $this->db->query(
128 "SELECT * FROM ut_lp_collections" .
129 " WHERE obj_id = " . $this->db->quote($a_obj_id,
"integer")
133 $items[] = $row->item_id;
141 public function delete():
void 143 $query =
"DELETE FROM ut_lp_collections" .
144 " WHERE obj_id = " . $this->db->quote($this->obj_id,
"integer");
145 $this->db->manipulate($query);
147 $query =
"DELETE FROM ut_lp_coll_manual" .
148 " WHERE obj_id = " . $this->db->quote($this->obj_id,
"integer");
149 $this->db->manipulate($query);
151 $this->items = array();
165 if (is_array($this->items)) {
166 return in_array($a_item_id, $this->items);
174 $query =
"INSERT INTO ut_lp_collections" .
175 " (obj_id, lpmode, item_id)" .
176 " VALUES (" . $this->db->quote($this->obj_id,
"integer") .
177 ", " . $this->db->quote($this->mode,
"integer") .
178 ", " . $this->db->quote($a_item_id,
"integer") .
180 $this->db->manipulate($query);
181 $this->items[] = $a_item_id;
188 $query =
"DELETE FROM ut_lp_collections" .
189 " WHERE obj_id = " . $this->db->quote($this->obj_id,
"integer") .
190 " AND item_id = " . $this->db->quote($a_item_id,
"integer");
191 $this->db->manipulate($query);
200 foreach ($a_item_ids as $item_id) {
210 foreach ($a_item_ids as $item_id) {
cloneCollection(int $a_target_id, int $a_copy_id)
const LP_MODE_MANUAL_BY_TUTOR
LP collection of objectives.
LP collection of learning module chapters.
deleteEntry(int $a_item_id)
const LP_MODE_COLLECTION_MANUAL
isAssignedEntry(int $a_item_id)
const LP_MODE_COLLECTION_TLT
static _lookupObjId(int $ref_id)
validateEntry(int $a_item_id)
LP collection of repository objects.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstanceByMode(int $a_obj_id, int $a_mode)
deactivateEntries(array $a_item_ids)
__construct(int $a_obj_id, int $a_mode)
LP collection base class.
const LP_MODE_COLLECTION_MOBS
activateEntries(array $a_item_ids)
static _getInstance(int $a_copy_id)
static getCollectionModes()