ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLPCollectionOfLMChapters Class Reference

LP collection of learning module chapters. More...

+ Inheritance diagram for ilLPCollectionOfLMChapters:
+ Collaboration diagram for ilLPCollectionOfLMChapters:

Public Member Functions

 getPossibleItems (int $a_ref_id)
 
 getTableGUIData (int $a_parent_ref_id)
 
- Public Member Functions inherited from ilLPCollection
 __construct (int $a_obj_id, int $a_mode)
 
 hasSelectableItems ()
 
 cloneCollection (int $a_target_id, int $a_copy_id)
 
 getItems ()
 
 delete ()
 
 isAssignedEntry (int $a_item_id)
 
 deactivateEntries (array $a_item_ids)
 
 activateEntries (array $a_item_ids)
 

Static Protected Attributes

static array $possible_items = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLPCollection
static getInstanceByMode (int $a_obj_id, int $a_mode)
 
static getCollectionModes ()
 
- Protected Member Functions inherited from ilLPCollection
 read (int $a_obj_id)
 
 validateEntry (int $a_item_id)
 
 addEntry (int $a_item_id)
 
 deleteEntry (int $a_item_id)
 
- Protected Attributes inherited from ilLPCollection
int $obj_id
 
int $mode
 
array $items = []
 
ilDBInterface $db
 
ilLogger $logger
 

Detailed Description

LP collection of learning module chapters.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilLPCollectionOfLMChapters.php.

Member Function Documentation

◆ getPossibleItems()

ilLPCollectionOfLMChapters::getPossibleItems ( int  $a_ref_id)
Returns
array|mixed

Definition at line 33 of file class.ilLPCollectionOfLMChapters.php.

References ilLPCollection\$items, ilLPCollection\$obj_id, ilLPStatus\_getTypicalLearningTime(), and ilObject\_lookupObjectId().

Referenced by getTableGUIData().

34  {
35  if (!isset(self::$possible_items[$a_ref_id])) {
37 
38  $items = array();
39 
40  // only top-level chapters
41  $tree = new ilTree($obj_id);
42  $tree->setTableNames('lm_tree', 'lm_data');
43  $tree->setTreeTablePK("lm_id");
44  foreach ($tree->getChilds($tree->readRootId()) as $child) {
45  if ($child["type"] == "st") {
47  $child["type"],
48  $obj_id,
49  $child["obj_id"]
50  );
51  $items[$child["obj_id"]] = $child;
52  }
53  }
54 
55  self::$possible_items[$a_ref_id] = $items;
56  }
57 
58  return self::$possible_items[$a_ref_id];
59  }
static _lookupObjectId(int $ref_id)
static _getTypicalLearningTime(string $type, int $obj_id, int $sub_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableGUIData()

ilLPCollectionOfLMChapters::getTableGUIData ( int  $a_parent_ref_id)
Returns
array

Definition at line 64 of file class.ilLPCollectionOfLMChapters.php.

References $data, ilObject\_lookupType(), getPossibleItems(), ilLPCollection\isAssignedEntry(), and ilLPObjSettings\LP_MODE_COLLECTION_TLT.

64  : array
65  {
66  $data = array();
67 
68  $parent_type = ilObject::_lookupType($a_parent_ref_id, true);
69 
70  foreach ($this->getPossibleItems($a_parent_ref_id) as $item) {
71  $tmp = array();
72  $tmp['id'] = $item['obj_id'];
73  $tmp['ref_id'] = 0;
74  $tmp['title'] = $item['title'];
75  $tmp['type'] = $item['type'];
76  $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
77 
78  // #12158
79  $tmp['url'] = ilLink::_getLink(
80  $a_parent_ref_id,
81  $parent_type,
82  [],
83  "_" . $tmp['id']
84  );
85 
86  if ($this->mode == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
87  $tmp['tlt'] = $item['tlt'];
88  }
89 
90  $data[] = $tmp;
91  }
92 
93  return $data;
94  }
isAssignedEntry(int $a_item_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $possible_items

array ilLPCollectionOfLMChapters::$possible_items = array()
staticprotected

Definition at line 28 of file class.ilLPCollectionOfLMChapters.php.


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