ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLPCollectionOfRepositoryObjects Class Reference

LP collection of repository objects. More...

+ Inheritance diagram for ilLPCollectionOfRepositoryObjects:
+ Collaboration diagram for ilLPCollectionOfRepositoryObjects:

Public Member Functions

 getPossibleItems ($a_ref_id, $a_full_data=false)
 
 cloneCollection ($a_target_id, $a_copy_id)
 
 deactivateEntries (array $a_item_ids)
 
 activateEntries (array $a_item_ids)
 
 createNewGrouping (array $a_item_ids, $a_num_obligatory=1)
 
 releaseGrouping (array $a_item_ids)
 
 saveObligatoryMaterials (array $a_obl)
 
 getTableGUIData ($a_parent_ref_id)
 
 getGroupedItemsForLPStatus ()
 
- Public Member Functions inherited from ilLPCollection
 __construct ($a_obj_id, $a_mode)
 
 hasSelectableItems ()
 
 cloneCollection ($a_target_id, $a_copy_id)
 
 getItems ()
 
 delete ()
 
 isAssignedEntry ($a_item_id)
 
 deactivateEntries (array $a_item_ids)
 
 activateEntries (array $a_item_ids)
 

Static Public Member Functions

static hasGroupedItems ($a_obj_id)
 
- Static Public Member Functions inherited from ilLPCollection
static getInstanceByMode ($a_obj_id, $a_mode)
 
static getCollectionModes ()
 

Protected Member Functions

 validateEntry ($a_item_ref_id, $a_item_type=null)
 
 read ($a_obj_id)
 
 addEntry ($a_item_id)
 
 deleteEntry ($a_item_id)
 
 getGroupingIds (array $a_item_ids)
 
 parseTableGUIItem ($a_id, array $a_item)
 
 getTableGUItemGroup ($item_id)
 
- Protected Member Functions inherited from ilLPCollection
 read ($a_obj_id)
 
 validateEntry ($a_item_id)
 
 addEntry ($a_item_id)
 
 deleteEntry ($a_item_id)
 

Static Protected Attributes

static $possible_items = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilLPCollection
 $obj_id
 
 $mode
 
 $items
 

Detailed Description

LP collection of repository objects.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilLPCollections.php 40326 2013-03-05 11:39:24Z jluetzen

Definition at line 16 of file class.ilLPCollectionOfRepositoryObjects.php.

Member Function Documentation

◆ activateEntries()

ilLPCollectionOfRepositoryObjects::activateEntries ( array  $a_item_ids)

Reimplemented from ilLPCollection.

Definition at line 303 of file class.ilLPCollectionOfRepositoryObjects.php.

304 {
305 global $DIC;
306
307 $ilDB = $DIC['ilDB'];
308
309 parent::activateEntries($a_item_ids);
310
311 $grouping_ids = $this->getGroupingIds($a_item_ids);
312 if ($grouping_ids) {
313 $query = "UPDATE ut_lp_collections" .
314 " SET active = " . $ilDB->quote(1, "integer") .
315 " WHERE " . $ilDB->in("grouping_id", $grouping_ids, false, "integer") .
316 " AND obj_id = " . $ilDB->quote($this->obj_id, "integer");
317 $ilDB->manipulate($query);
318 }
319 }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, $query, and getGroupingIds().

Referenced by createNewGrouping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEntry()

ilLPCollectionOfRepositoryObjects::addEntry (   $a_item_id)
protected

Reimplemented from ilLPCollection.

Definition at line 207 of file class.ilLPCollectionOfRepositoryObjects.php.

208 {
209 global $DIC;
210
211 $ilDB = $DIC['ilDB'];
212
213 // only active entries are assigned!
214 if (!$this->isAssignedEntry($a_item_id)) {
215 // #13278 - because of grouping inactive items may exist
216 $this->deleteEntry($a_item_id);
217
218 $query = "INSERT INTO ut_lp_collections" .
219 " (obj_id, lpmode, item_id, grouping_id, num_obligatory, active)" .
220 " VALUES (" . $ilDB->quote($this->obj_id, "integer") .
221 ", " . $ilDB->quote($this->mode, "integer") .
222 ", " . $ilDB->quote($a_item_id, "integer") .
223 ", " . $ilDB->quote(0, "integer") .
224 ", " . $ilDB->quote(0, "integer") .
225 ", " . $ilDB->quote(1, "integer") .
226 ")";
227 $ilDB->manipulate($query);
228 $this->items[] = $a_item_id;
229 }
230 return true;
231 }
isAssignedEntry($a_item_id)

References $DIC, $ilDB, $query, deleteEntry(), and ilLPCollection\isAssignedEntry().

Referenced by cloneCollection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneCollection()

ilLPCollectionOfRepositoryObjects::cloneCollection (   $a_target_id,
  $a_copy_id 
)

Reimplemented from ilLPCollection.

Definition at line 134 of file class.ilLPCollectionOfRepositoryObjects.php.

135 {
136 parent::cloneCollection($a_target_id, $a_copy_id);
137
138 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
139 $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
140 $mappings = $cwo->getMappings();
141
142 $target_obj_id = ilObject::_lookupObjId($a_target_id);
143 $target_collection = new static($target_obj_id, $this->mode);
144
145 // clone (active) groupings
146 foreach ($this->getGroupedItemsForLPStatus() as $grouping_id => $group) {
147 $target_item_ids = array();
148 foreach ($group["items"] as $item) {
149 if (!isset($mappings[$item]) or !$mappings[$item]) {
150 continue;
151 }
152
153 $target_item_ids[] = $mappings[$item];
154 }
155
156 // grouping - if not only single item left after copy?
157 if ($grouping_id && sizeof($target_item_ids) > 1) {
158 // should not be larger than group
159 $num_obligatory = min(sizeof($target_item_ids), $group["num_obligatory"]);
160
161 $target_collection->createNewGrouping($target_item_ids, $num_obligatory);
162 } else {
163 // #15487 - single items
164 foreach ($target_item_ids as $item_id) {
165 $this->addEntry($item_id);
166 }
167 }
168 }
169 }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _lookupObjId($a_id)

References ilLPCollection\$mode, ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), addEntry(), and getGroupedItemsForLPStatus().

+ Here is the call graph for this function:

◆ createNewGrouping()

ilLPCollectionOfRepositoryObjects::createNewGrouping ( array  $a_item_ids,
  $a_num_obligatory = 1 
)

Definition at line 321 of file class.ilLPCollectionOfRepositoryObjects.php.

322 {
323 global $DIC;
324
325 $ilDB = $DIC['ilDB'];
326
327 $this->activateEntries($a_item_ids);
328
329 $all_item_ids = array();
330
331 $grouping_ids = $this->getGroupingIds($a_item_ids);
332
333 $query = "SELECT item_id FROM ut_lp_collections" .
334 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
335 " AND " . $ilDB->in("grouping_id", $grouping_ids, false, "integer");
336 $res = $ilDB->query($query);
337 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
338 $all_item_ids[] = $row->item_id;
339 }
340
341 $all_item_ids = array_unique(array_merge($all_item_ids, $a_item_ids));
342
343 $this->releaseGrouping($a_item_ids);
344
345 // Create new grouping
346 $query = "SELECT MAX(grouping_id) grp FROM ut_lp_collections" .
347 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
348 " GROUP BY obj_id";
349 $res = $ilDB->query($query);
350 $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
351 $grp_id = $row->grp;
352 ++$grp_id;
353
354 $query = "UPDATE ut_lp_collections SET" .
355 " grouping_id = " . $ilDB->quote($grp_id, "integer") .
356 ", num_obligatory = " . $ilDB->quote($a_num_obligatory, "integer") .
357 ", active = " . $ilDB->quote(1, "integer") .
358 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
359 " AND " . $ilDB->in("item_id", $all_item_ids, false, "integer");
360 $ilDB->manipulate($query);
361
362 return;
363 }
foreach($_POST as $key=> $value) $res

References $DIC, $ilDB, $query, $res, activateEntries(), ilDBConstants\FETCHMODE_OBJECT, getGroupingIds(), and releaseGrouping().

+ Here is the call graph for this function:

◆ deactivateEntries()

ilLPCollectionOfRepositoryObjects::deactivateEntries ( array  $a_item_ids)

Reimplemented from ilLPCollection.

Definition at line 285 of file class.ilLPCollectionOfRepositoryObjects.php.

286 {
287 global $DIC;
288
289 $ilDB = $DIC['ilDB'];
290
291 parent::deactivateEntries($a_item_ids);
292
293 $grouping_ids = $this->getGroupingIds($a_item_ids);
294 if ($grouping_ids) {
295 $query = "UPDATE ut_lp_collections" .
296 " SET active = " . $ilDB->quote(0, "integer") .
297 " WHERE " . $ilDB->in("grouping_id", $grouping_ids, false, "integer") .
298 " AND obj_id = " . $ilDB->quote($this->obj_id, "integer");
299 $ilDB->manipulate($query);
300 }
301 }

References $DIC, $ilDB, $query, and getGroupingIds().

+ Here is the call graph for this function:

◆ deleteEntry()

ilLPCollectionOfRepositoryObjects::deleteEntry (   $a_item_id)
protected

Reimplemented from ilLPCollection.

Definition at line 233 of file class.ilLPCollectionOfRepositoryObjects.php.

234 {
235 global $DIC;
236
237 $ilDB = $DIC['ilDB'];
238
239 $query = "DELETE FROM ut_lp_collections " .
240 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
241 " AND item_id = " . $ilDB->quote($a_item_id, "integer") .
242 " AND grouping_id = " . $ilDB->quote(0, "integer");
243 $ilDB->manipulate($query);
244 return true;
245 }

References $DIC, $ilDB, and $query.

Referenced by addEntry(), and read().

+ Here is the caller graph for this function:

◆ getGroupedItemsForLPStatus()

ilLPCollectionOfRepositoryObjects::getGroupedItemsForLPStatus ( )

Definition at line 493 of file class.ilLPCollectionOfRepositoryObjects.php.

494 {
495 global $DIC;
496
497 $ilDB = $DIC['ilDB'];
498
499 $items = $this->getItems();
500
501 $query = " SELECT * FROM ut_lp_collections" .
502 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
503 " AND active = " . $ilDB->quote(1, "integer");
504 $res = $ilDB->query($query);
505
506 $grouped = array();
507 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
508 if (in_array($row->item_id, $items)) {
509 $grouped[$row->grouping_id]['items'][] = $row->item_id;
510 $grouped[$row->grouping_id]['num_obligatory'] = $row->num_obligatory;
511 }
512 }
513
514 return $grouped;
515 }

References $DIC, $ilDB, ilLPCollection\$items, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ilLPCollection\getItems().

Referenced by cloneCollection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupingIds()

ilLPCollectionOfRepositoryObjects::getGroupingIds ( array  $a_item_ids)
protected

Definition at line 265 of file class.ilLPCollectionOfRepositoryObjects.php.

266 {
267 global $DIC;
268
269 $ilDB = $DIC['ilDB'];
270
271 $grouping_ids = array();
272
273 $query = "SELECT grouping_id FROM ut_lp_collections" .
274 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
275 " AND " . $ilDB->in("item_id", $a_item_ids, false, "integer") .
276 " AND grouping_id > " . $ilDB->quote(0, "integer");
277 $res = $ilDB->query($query);
278 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
279 $grouping_ids[] = $row->grouping_id;
280 }
281
282 return $grouping_ids;
283 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by activateEntries(), createNewGrouping(), deactivateEntries(), and releaseGrouping().

+ Here is the caller graph for this function:

◆ getPossibleItems()

ilLPCollectionOfRepositoryObjects::getPossibleItems (   $a_ref_id,
  $a_full_data = false 
)

Definition at line 20 of file class.ilLPCollectionOfRepositoryObjects.php.

21 {
22 global $DIC;
23
24 $tree = $DIC['tree'];
25 $objDefinition = $DIC['objDefinition'];
26
27 $cache_idx = $a_ref_id . "__" . $a_full_data;
28
29 if (!isset(self::$possible_items[$cache_idx])) {
30 $all_possible = array();
31
32 if (!$tree->isDeleted($a_ref_id)) {
33 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
34
35 if (!$a_full_data) {
36 $data = $tree->getRbacSubTreeInfo($a_ref_id);
37 } else {
38 $node = $tree->getNodeData($a_ref_id);
39 $data = $tree->getSubTree($node);
40 }
41 foreach ($data as $node) {
42 if (!$a_full_data) {
43 $item_ref_id = $node['child'];
44 } else {
45 $item_ref_id = $node['ref_id'];
46 }
47
48 // avoid recursion
49 if ($item_ref_id == $a_ref_id ||
50 !$this->validateEntry($item_ref_id, $node['type'])) {
51 continue;
52 }
53
54 switch ($node['type']) {
55 case 'sess':
56 case 'exc':
57 case 'fold':
58 case 'grp':
59 case 'sahs':
60 case 'lm':
61 case 'tst':
62 case 'file':
63 case 'mcst':
64 case 'htlm':
65 case 'svy':
66 case "prg":
67 case 'iass':
68 case 'copa':
69 case 'cmix':
70 case 'lti':
71 case 'lso':
72 case 'crsr':
73 if (!$a_full_data) {
74 $all_possible[] = $item_ref_id;
75 } else {
76 $all_possible[$item_ref_id] = array(
77 'ref_id' => $item_ref_id,
78 'obj_id' => $node['obj_id'],
79 'title' => $node['title'],
80 'description' => $node['description'],
81 'type' => $node['type']
82 );
83 }
84 break;
85
86 // repository plugin object?
87 case $objDefinition->isPluginTypeName($node['type']):
88 $only_active = false;
89 if (!$this->isAssignedEntry($item_ref_id)) {
90 $only_active = true;
91 }
92 if (ilRepositoryObjectPluginSlot::isTypePluginWithLP($node['type'], $only_active)) {
93 if (!$a_full_data) {
94 $all_possible[] = $item_ref_id;
95 } else {
96 $all_possible[$item_ref_id] = array(
97 'ref_id' => $item_ref_id,
98 'obj_id' => $node['obj_id'],
99 'title' => $node['title'],
100 'description' => $node['description'],
101 'type' => $node['type']
102 );
103 }
104 }
105 break;
106 }
107 }
108 }
109
110 self::$possible_items[$cache_idx] = $all_possible;
111 }
112
113 return self::$possible_items[$cache_idx];
114 }
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
$data
Definition: storeScorm.php:23

References $data, $DIC, ilLPCollection\isAssignedEntry(), ilRepositoryObjectPluginSlot\isTypePluginWithLP(), and validateEntry().

Referenced by getTableGUIData(), and read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableGUIData()

ilLPCollectionOfRepositoryObjects::getTableGUIData (   $a_parent_ref_id)

Definition at line 413 of file class.ilLPCollectionOfRepositoryObjects.php.

414 {
415 $items = $this->getPossibleItems($a_parent_ref_id, true);
416
417 $data = array();
418 $done = array();
419 foreach ($items as $item_id => $item) {
420 if (in_array($item_id, $done)) {
421 continue;
422 }
423
424 $table_item = $this->parseTableGUIItem($item_id, $item);
425
426 // grouping
427 $table_item['grouped'] = array();
428 $grouped_items = $this->getTableGUItemGroup($item_id);
429 if (count((array) $grouped_items['items']) > 1) {
430 foreach ($grouped_items['items'] as $grouped_item_id) {
431 if ($grouped_item_id == $item_id ||
432 !is_array($items[$grouped_item_id])) { // #15498
433 continue;
434 }
435
436 $table_item['grouped'][] = $this->parseTableGUIItem($grouped_item_id, $items[$grouped_item_id]);
437 $table_item['num_obligatory'] = $grouped_items['num_obligatory'];
438 $table_item['grouping_id'] = $grouped_items['grouping_id'];
439
440 $done[] = $grouped_item_id;
441 }
442 }
443
444 $data[] = $table_item;
445 }
446
447 return $data;
448 }

References $data, ilLPCollection\$items, getPossibleItems(), getTableGUItemGroup(), and parseTableGUIItem().

+ Here is the call graph for this function:

◆ getTableGUItemGroup()

ilLPCollectionOfRepositoryObjects::getTableGUItemGroup (   $item_id)
protected

Definition at line 464 of file class.ilLPCollectionOfRepositoryObjects.php.

465 {
466 global $DIC;
467
468 $ilDB = $DIC['ilDB'];
469
470 $items = array();
471
472 $query = "SELECT grouping_id FROM ut_lp_collections" .
473 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
474 " AND item_id = " . $ilDB->quote($item_id, "integer");
475 $res = $ilDB->query($query);
476 $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
477 $grouping_id = $row->grouping_id;
478 if ($grouping_id > 0) {
479 $query = "SELECT item_id, num_obligatory FROM ut_lp_collections" .
480 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
481 " AND grouping_id = " . $ilDB->quote($grouping_id, "integer");
482 $res = $ilDB->query($query);
483 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
484 $items['items'][] = $row->item_id;
485 $items['num_obligatory'] = $row->num_obligatory;
486 $items['grouping_id'] = $grouping_id;
487 }
488 }
489
490 return $items;
491 }

References $DIC, $ilDB, ilLPCollection\$items, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by getTableGUIData().

+ Here is the caller graph for this function:

◆ hasGroupedItems()

static ilLPCollectionOfRepositoryObjects::hasGroupedItems (   $a_obj_id)
static

Definition at line 252 of file class.ilLPCollectionOfRepositoryObjects.php.

253 {
254 global $DIC;
255
256 $ilDB = $DIC['ilDB'];
257
258 $query = "SELECT item_id FROM ut_lp_collections" .
259 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer") .
260 " AND grouping_id > " . $ilDB->quote(0, "integer");
261 $res = $ilDB->query($query);
262 return $res->numRows() ? true : false;
263 }

References $DIC, $ilDB, $query, and $res.

Referenced by ilLPCollectionSettingsTableGUI\parse().

+ Here is the caller graph for this function:

◆ parseTableGUIItem()

ilLPCollectionOfRepositoryObjects::parseTableGUIItem (   $a_id,
array  $a_item 
)
protected

Definition at line 450 of file class.ilLPCollectionOfRepositoryObjects.php.

451 {
452 $table_item = $a_item;
453 $table_item['id'] = $a_id;
454 $table_item['status'] = $this->isAssignedEntry($a_id);
455
456 $olp = ilObjectLP::getInstance($a_item['obj_id']);
457 $table_item['mode_id'] = $olp->getCurrentMode();
458 $table_item['mode'] = $olp->getModeText($table_item['mode_id']);
459 $table_item['anonymized'] = $olp->isAnonymized();
460
461 return $table_item;
462 }
static getInstance($a_obj_id)

References ilObjectLP\getInstance(), and ilLPCollection\isAssignedEntry().

Referenced by getTableGUIData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilLPCollectionOfRepositoryObjects::read (   $a_obj_id)
protected

Reimplemented from ilLPCollection.

Definition at line 176 of file class.ilLPCollectionOfRepositoryObjects.php.

177 {
178 global $DIC;
179
180 $ilDB = $DIC['ilDB'];
181
182 $items = array();
183
184 $ref_ids = ilObject::_getAllReferences($a_obj_id);
185 $ref_id = end($ref_ids);
186 $possible = $this->getPossibleItems($ref_id);
187
188 $res = $ilDB->query("SELECT utc.item_id, obd.type" .
189 " FROM ut_lp_collections utc" .
190 " JOIN object_reference obr ON item_id = ref_id" .
191 " JOIN object_data obd ON obr.obj_id = obd.obj_id" .
192 " WHERE utc.obj_id = " . $ilDB->quote($a_obj_id, "integer") .
193 " AND active = " . $ilDB->quote(1, "integer") .
194 " ORDER BY title");
195 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
196 if (in_array($row->item_id, $possible) &&
197 $this->validateEntry($row->item_id, $row->type)) {
198 $items[] = $row->item_id;
199 } else {
200 $this->deleteEntry($row->item_id);
201 }
202 }
203
204 $this->items = $items;
205 }
static _getAllReferences($a_id)
get all reference ids of object

References $DIC, $ilDB, ilLPCollection\$items, $res, ilObject\_getAllReferences(), deleteEntry(), ilDBConstants\FETCHMODE_OBJECT, and getPossibleItems().

+ Here is the call graph for this function:

◆ releaseGrouping()

ilLPCollectionOfRepositoryObjects::releaseGrouping ( array  $a_item_ids)

Definition at line 365 of file class.ilLPCollectionOfRepositoryObjects.php.

366 {
367 global $DIC;
368
369 $ilDB = $DIC['ilDB'];
370
371 $grouping_ids = $this->getGroupingIds($a_item_ids);
372
373 $query = "UPDATE ut_lp_collections" .
374 " SET grouping_id = " . $ilDB->quote(0, "integer") .
375 ", num_obligatory = " . $ilDB->quote(0, "integer") .
376 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
377 " AND " . $ilDB->in("grouping_id", $grouping_ids, false, "integer");
378 $ilDB->manipulate($query);
379 }

References $DIC, $ilDB, $query, and getGroupingIds().

Referenced by createNewGrouping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObligatoryMaterials()

ilLPCollectionOfRepositoryObjects::saveObligatoryMaterials ( array  $a_obl)

Definition at line 381 of file class.ilLPCollectionOfRepositoryObjects.php.

382 {
383 global $DIC;
384
385 $ilDB = $DIC['ilDB'];
386
387 foreach ($a_obl as $grouping_id => $num) {
388 $query = "SELECT count(obj_id) num FROM ut_lp_collections" .
389 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
390 " AND grouping_id = " . $ilDB->quote($grouping_id, 'integer') .
391 " GROUP BY obj_id";
392 $res = $ilDB->query($query);
393 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
394 if ($num <= 0 || $num >= $row->num) {
395 throw new UnexpectedValueException();
396 }
397 }
398 }
399 foreach ($a_obl as $grouping_id => $num) {
400 $query = "UPDATE ut_lp_collections" .
401 " SET num_obligatory = " . $ilDB->quote($num, "integer") .
402 " WHERE obj_id = " . $ilDB->quote($this->obj_id, "integer") .
403 " AND grouping_id = " . $ilDB->quote($grouping_id, "integer");
404 $ilDB->manipulate($query);
405 }
406 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ validateEntry()

ilLPCollectionOfRepositoryObjects::validateEntry (   $a_item_ref_id,
  $a_item_type = null 
)
protected

Definition at line 116 of file class.ilLPCollectionOfRepositoryObjects.php.

117 {
118 if (!$a_item_type) {
119 $a_item_type = ilObject::_lookupType($a_item_ref_id, true);
120 }
121
122 // this is hardcoded so we do not need to call all ObjectLP types
123 if ($a_item_type == 'tst') {
124 // Check anonymized
125 $item_obj_id = ilObject::_lookupObjId($a_item_ref_id);
126 $olp = ilObjectLP::getInstance($item_obj_id);
127 if ($olp->isAnonymized()) {
128 return false;
129 }
130 }
131 return true;
132 }
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObjectLP\getInstance().

Referenced by getPossibleItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $possible_items

ilLPCollectionOfRepositoryObjects::$possible_items = array()
staticprotected

Definition at line 18 of file class.ilLPCollectionOfRepositoryObjects.php.


The documentation for this class was generated from the following file: