ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
 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 ()
 
 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)

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

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

Referenced by createNewGrouping().

319  {
320  global $ilDB;
321 
322  parent::activateEntries($a_item_ids);
323 
324  $grouping_ids = $this->getGroupingIds($a_item_ids);
325  if($grouping_ids)
326  {
327  $query = "UPDATE ut_lp_collections".
328  " SET active = ".$ilDB->quote(1, "integer").
329  " WHERE ".$ilDB->in("grouping_id", $grouping_ids, false, "integer").
330  " AND obj_id = ".$ilDB->quote($this->obj_id, "integer");
331  $ilDB->manipulate($query);
332  }
333  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEntry()

ilLPCollectionOfRepositoryObjects::addEntry (   $a_item_id)
protected

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

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

Referenced by cloneCollection().

230  {
231  global $ilDB;
232 
233  // only active entries are assigned!
234  if(!$this->isAssignedEntry($a_item_id))
235  {
236  // #13278 - because of grouping inactive items may exist
237  $this->deleteEntry($a_item_id);
238 
239  $query = "INSERT INTO ut_lp_collections".
240  " (obj_id, lpmode, item_id, grouping_id, num_obligatory, active)".
241  " VALUES (".$ilDB->quote($this->obj_id , "integer").
242  ", ".$ilDB->quote($this->mode, "integer").
243  ", ".$ilDB->quote($a_item_id , "integer").
244  ", ".$ilDB->quote(0, "integer").
245  ", ".$ilDB->quote(0, "integer").
246  ", ".$ilDB->quote(1, "integer").
247  ")";
248  $ilDB->manipulate($query);
249  $this->items[] = $a_item_id;
250  }
251  return true;
252  }
isAssignedEntry($a_item_id)
global $ilDB
+ 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 
)

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

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

148  {
149  parent::cloneCollection($a_target_id, $a_copy_id);
150 
151  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
152  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
153  $mappings = $cwo->getMappings();
154 
155  $target_obj_id = ilObject::_lookupObjId($a_target_id);
156  $target_collection = new static($target_obj_id, $this->mode);
157 
158  // clone (active) groupings
159  foreach($this->getGroupedItemsForLPStatus() as $grouping_id => $group)
160  {
161  $target_item_ids = array();
162  foreach($group["items"] as $item)
163  {
164  if(!isset($mappings[$item]) or !$mappings[$item])
165  {
166  continue;
167  }
168 
169  $target_item_ids[] = $mappings[$item];
170  }
171 
172  // grouping - if not only single item left after copy?
173  if($grouping_id && sizeof($target_item_ids) > 1)
174  {
175  // should not be larger than group
176  $num_obligatory = min(sizeof($target_item_ids), $group["num_obligatory"]);
177 
178  $target_collection->createNewGrouping($target_item_ids, $num_obligatory);
179  }
180  else
181  {
182  // #15487 - single items
183  foreach($target_item_ids as $item_id)
184  {
185  $this->addEntry($item_id);
186  }
187  }
188  }
189  }
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ createNewGrouping()

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

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

References $ilDB, $query, $res, $row, activateEntries(), DB_FETCHMODE_OBJECT, getGroupingIds(), and releaseGrouping().

336  {
337  global $ilDB;
338 
339  $this->activateEntries($a_item_ids);
340 
341  $all_item_ids = array();
342 
343  $grouping_ids = $this->getGroupingIds($a_item_ids);
344 
345  $query = "SELECT item_id FROM ut_lp_collections".
346  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
347  " AND ".$ilDB->in("grouping_id", $grouping_ids, false, "integer");
348  $res = $ilDB->query($query);
349  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
350  {
351  $all_item_ids[] = $row->item_id;
352  }
353 
354  $all_item_ids = array_unique(array_merge($all_item_ids, $a_item_ids));
355 
356  $this->releaseGrouping($a_item_ids);
357 
358  // Create new grouping
359  $query = "SELECT MAX(grouping_id) grp FROM ut_lp_collections".
360  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
361  " GROUP BY obj_id";
362  $res = $ilDB->query($query);
363  $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
364  $grp_id = $row->grp;
365  ++$grp_id;
366 
367  $query = "UPDATE ut_lp_collections SET".
368  " grouping_id = ".$ilDB->quote($grp_id, "integer").
369  ", num_obligatory = ".$ilDB->quote($a_num_obligatory, "integer").
370  ", active = ".$ilDB->quote(1, "integer").
371  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
372  " AND ".$ilDB->in("item_id", $all_item_ids, false, "integer");
373  $ilDB->manipulate($query);
374 
375  return;
376  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the call graph for this function:

◆ deactivateEntries()

ilLPCollectionOfRepositoryObjects::deactivateEntries ( array  $a_item_ids)

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

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

302  {
303  global $ilDB;
304 
305  parent::deactivateEntries($a_item_ids);
306 
307  $grouping_ids = $this->getGroupingIds($a_item_ids);
308  if($grouping_ids)
309  {
310  $query = "UPDATE ut_lp_collections".
311  " SET active = ".$ilDB->quote(0, "integer").
312  " WHERE ".$ilDB->in("grouping_id", $grouping_ids, false, "integer").
313  " AND obj_id = ".$ilDB->quote($this->obj_id, "integer");
314  $ilDB->manipulate($query);
315  }
316  }
global $ilDB
+ Here is the call graph for this function:

◆ deleteEntry()

ilLPCollectionOfRepositoryObjects::deleteEntry (   $a_item_id)
protected

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

References $ilDB, and $query.

Referenced by addEntry(), and read().

255  {
256  global $ilDB;
257 
258  $query = "DELETE FROM ut_lp_collections ".
259  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
260  " AND item_id = ".$ilDB->quote($a_item_id, "integer").
261  " AND grouping_id = ".$ilDB->quote(0, "integer");
262  $ilDB->manipulate($query);
263  return true;
264  }
global $ilDB
+ Here is the caller graph for this function:

◆ getGroupedItemsForLPStatus()

ilLPCollectionOfRepositoryObjects::getGroupedItemsForLPStatus ( )

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

References $ilDB, ilLPCollection\$items, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilLPCollection\getItems().

Referenced by cloneCollection().

512  {
513  global $ilDB;
514 
515  $items = $this->getItems();
516 
517  $query = " SELECT * FROM ut_lp_collections".
518  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
519  " AND active = ".$ilDB->quote(1, "integer");
520  $res = $ilDB->query($query);
521 
522  $grouped = array();
523  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
524  {
525  if(in_array($row->item_id, $items))
526  {
527  $grouped[$row->grouping_id]['items'][] = $row->item_id;
528  $grouped[$row->grouping_id]['num_obligatory'] = $row->num_obligatory;
529  }
530  }
531 
532  return $grouped;
533  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ 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 282 of file class.ilLPCollectionOfRepositoryObjects.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

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

283  {
284  global $ilDB;
285 
286  $grouping_ids = array();
287 
288  $query = "SELECT grouping_id FROM ut_lp_collections".
289  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
290  " AND ".$ilDB->in("item_id", $a_item_ids, false, "integer").
291  " AND grouping_id > ".$ilDB->quote(0, "integer");
292  $res = $ilDB->query($query);
293  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
294  {
295  $grouping_ids[] = $row->grouping_id;
296  }
297 
298  return $grouping_ids;
299  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ 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.

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

Referenced by getTableGUIData(), and read().

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

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

427  {
428  $items = $this->getPossibleItems($a_parent_ref_id, true);
429 
430  $data = array();
431  $done = array();
432  foreach($items as $item_id => $item)
433  {
434  if(in_array($item_id, $done))
435  {
436  continue;
437  }
438 
439  $table_item = $this->parseTableGUIItem($item_id, $item);
440 
441  // grouping
442  $table_item['grouped'] = array();
443  $grouped_items = $this->getTableGUItemGroup($item_id);
444  if(count((array)$grouped_items['items']) > 1)
445  {
446  foreach($grouped_items['items'] as $grouped_item_id)
447  {
448  if($grouped_item_id == $item_id ||
449  !is_array($items[$grouped_item_id])) // #15498
450  {
451  continue;
452  }
453 
454  $table_item['grouped'][] = $this->parseTableGUIItem($grouped_item_id, $items[$grouped_item_id]);
455  $table_item['num_obligatory'] = $grouped_items['num_obligatory'];
456  $table_item['grouping_id'] = $grouped_items['grouping_id'];
457 
458  $done[] = $grouped_item_id;
459  }
460  }
461 
462  $data[] = $table_item;
463  }
464 
465  return $data;
466  }
$data
+ Here is the call graph for this function:

◆ getTableGUItemGroup()

ilLPCollectionOfRepositoryObjects::getTableGUItemGroup (   $item_id)
protected

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

References $ilDB, ilLPCollection\$items, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by getTableGUIData().

483  {
484  global $ilDB;
485 
486  $items = array();
487 
488  $query = "SELECT grouping_id FROM ut_lp_collections".
489  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
490  " AND item_id = ".$ilDB->quote($item_id, "integer");
491  $res = $ilDB->query($query);
492  $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
493  $grouping_id = $row->grouping_id;
494  if($grouping_id > 0)
495  {
496  $query = "SELECT item_id, num_obligatory FROM ut_lp_collections".
497  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
498  " AND grouping_id = ".$ilDB->quote($grouping_id, "integer");
499  $res = $ilDB->query($query);
500  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
501  {
502  $items['items'][] = $row->item_id;
503  $items['num_obligatory'] = $row->num_obligatory;
504  $items['grouping_id'] = $grouping_id;
505  }
506  }
507 
508  return $items;
509  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ hasGroupedItems()

static ilLPCollectionOfRepositoryObjects::hasGroupedItems (   $a_obj_id)
static

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

References $ilDB, $query, and $res.

Referenced by ilLPCollectionSettingsTableGUI\parse().

272  {
273  global $ilDB;
274 
275  $query = "SELECT item_id FROM ut_lp_collections".
276  " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer").
277  " AND grouping_id > ".$ilDB->quote(0, "integer");
278  $res = $ilDB->query($query);
279  return $res->numRows() ? true : false;
280  }
global $ilDB
+ Here is the caller graph for this function:

◆ parseTableGUIItem()

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

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

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

Referenced by getTableGUIData().

469  {
470  $table_item = $a_item;
471  $table_item['id'] = $a_id;
472  $table_item['status'] = $this->isAssignedEntry($a_id);
473 
474  $olp = ilObjectLP::getInstance($a_item['obj_id']);
475  $table_item['mode_id'] = $olp->getCurrentMode();
476  $table_item['mode'] = $olp->getModeText($table_item['mode_id']);
477  $table_item['anonymized'] = $olp->isAnonymized();
478 
479  return $table_item;
480  }
isAssignedEntry($a_item_id)
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilLPCollectionOfRepositoryObjects::read ( )
protected

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

References $ilDB, ilLPCollection\$items, $ref_id, $res, $row, ilObject\_getAllReferences(), DB_FETCHMODE_OBJECT, deleteEntry(), getPossibleItems(), and validateEntry().

197  {
198  global $ilDB;
199 
200  $items = array();
201 
202  $ref_ids = ilObject::_getAllReferences($this->obj_id);
203  $ref_id = end($ref_ids);
204  $possible = $this->getPossibleItems($ref_id);
205 
206  $res = $ilDB->query("SELECT utc.item_id, obd.type".
207  " FROM ut_lp_collections utc".
208  " JOIN object_reference obr ON item_id = ref_id".
209  " JOIN object_data obd ON obr.obj_id = obd.obj_id".
210  " WHERE utc.obj_id = ".$ilDB->quote($this->obj_id, "integer").
211  " AND active = ".$ilDB->quote(1, "integer").
212  " ORDER BY title");
213  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
214  {
215  if(in_array($row->item_id, $possible) &&
216  $this->validateEntry($row->item_id, $row->type))
217  {
218  $items[] = $row->item_id;
219  }
220  else
221  {
222  $this->deleteEntry($row->item_id);
223  }
224  }
225 
226  $this->items = $items;
227  }
static _getAllReferences($a_id)
get all reference ids of object
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$ref_id
Definition: sahs_server.php:39
global $ilDB
+ Here is the call graph for this function:

◆ releaseGrouping()

ilLPCollectionOfRepositoryObjects::releaseGrouping ( array  $a_item_ids)

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

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

Referenced by createNewGrouping().

379  {
380  global $ilDB;
381 
382  $grouping_ids = $this->getGroupingIds($a_item_ids);
383 
384  $query = "UPDATE ut_lp_collections".
385  " SET grouping_id = ".$ilDB->quote(0, "integer").
386  ", num_obligatory = ".$ilDB->quote(0, "integer").
387  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
388  " AND " . $ilDB->in("grouping_id", $grouping_ids, false, "integer");
389  $ilDB->manipulate($query);
390  }
global $ilDB
+ 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 392 of file class.ilLPCollectionOfRepositoryObjects.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

393  {
394  global $ilDB;
395 
396  foreach($a_obl as $grouping_id => $num)
397  {
398  $query = "SELECT count(obj_id) num FROM ut_lp_collections".
399  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
400  " AND grouping_id = ".$ilDB->quote($grouping_id,'integer').
401  " GROUP BY obj_id";
402  $res = $ilDB->query($query);
403  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
404  {
405  if($num <= 0 || $num >= $row->num)
406  {
407  throw new UnexpectedValueException();
408  }
409  }
410  }
411  foreach($a_obl as $grouping_id => $num)
412  {
413  $query = "UPDATE ut_lp_collections".
414  " SET num_obligatory = ".$ilDB->quote($num, "integer").
415  " WHERE obj_id = ".$ilDB->quote($this->obj_id, "integer").
416  " AND grouping_id = ".$ilDB->quote($grouping_id, "integer");
417  $ilDB->manipulate($query);
418  }
419  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

◆ validateEntry()

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

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

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

Referenced by getPossibleItems(), and read().

127  {
128  if(!$a_item_type)
129  {
130  $a_item_type = ilObject::_lookupType($a_item_ref_id, true);
131  }
132 
133  // this is hardcoded so we do not need to call all ObjectLP types
134  if($a_item_type == 'tst')
135  {
136  // Check anonymized
137  $item_obj_id = ilObject::_lookupObjId($a_item_ref_id);
138  $olp = ilObjectLP::getInstance($item_obj_id);
139  if($olp->isAnonymized())
140  {
141  return false;
142  }
143  }
144  return true;
145  }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_obj_id)
+ 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: