ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLPCollectionOfMediaObjects Class Reference

LP collection of media objects. More...

+ Inheritance diagram for ilLPCollectionOfMediaObjects:
+ Collaboration diagram for ilLPCollectionOfMediaObjects:

Public Member Functions

 getPossibleItems ()
 
 getTableGUIData (int $a_parent_ref_id)
 
 cloneCollection (int $a_target_id, int $a_copy_id, ?array $mob_mapping=null)
 Scorm items are not copied, they are newly created by reading the manifest. More...
 
- 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 media objects.

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 25 of file class.ilLPCollectionOfMediaObjects.php.

Member Function Documentation

◆ cloneCollection()

ilLPCollectionOfMediaObjects::cloneCollection ( int  $a_target_id,
int  $a_copy_id,
?array  $mob_mapping = null 
)

Scorm items are not copied, they are newly created by reading the manifest.

Therefore, they do not have a mapping. So we need to map them via the import_id/identifierref

Parameters
int$a_target_id
int$a_copy_id

Definition at line 68 of file class.ilLPCollectionOfMediaObjects.php.

68 : void
69 {
70 $target_obj_id = ilObject::_lookupObjId($a_target_id);
71 $new_collection = new static($target_obj_id, $this->mode);
72 $possible_items = $new_collection->getPossibleItems();
73 foreach ($this->items as $item_id) {
74 if (isset($mob_mapping[$item_id]) && isset($possible_items[$mob_mapping[$item_id]])) {
75 $new_collection->addEntry($mob_mapping[$item_id]);
76 }
77 }
78 }
static _lookupObjId(int $ref_id)

References ilLPCollection\$mode, $possible_items, and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ getPossibleItems()

ilLPCollectionOfMediaObjects::getPossibleItems ( )

Definition at line 29 of file class.ilLPCollectionOfMediaObjects.php.

29 : array
30 {
31 if (!isset(self::$possible_items[$this->obj_id])) {
32 $items = array();
33
34 $cast = new ilObjMediaCast($this->obj_id, false);
35
36 foreach ($cast->getSortedItemsArray() as $item) {
37 $items[$item["mob_id"]] = array("title" => $item["title"]);
38 }
39 self::$possible_items[$this->obj_id] = $items;
40 }
41 return self::$possible_items[$this->obj_id];
42 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilLPCollection\$items, and ilLPCollection\$obj_id.

Referenced by getTableGUIData().

+ Here is the caller graph for this function:

◆ getTableGUIData()

ilLPCollectionOfMediaObjects::getTableGUIData ( int  $a_parent_ref_id)

Definition at line 44 of file class.ilLPCollectionOfMediaObjects.php.

44 : array
45 {
46 $data = array();
47
48 foreach ($this->getPossibleItems() as $mob_id => $item) {
49 $tmp = array();
50 $tmp['id'] = $mob_id;
51 $tmp['ref_id'] = 0;
52 $tmp['type'] = 'mob';
53 $tmp['title'] = $item['title'];
54 $tmp['status'] = $this->isAssignedEntry($mob_id);
55
56 $data[] = $tmp;
57 }
58
59 return $data;
60 }
isAssignedEntry(int $a_item_id)

References $data, getPossibleItems(), and ilLPCollection\isAssignedEntry().

+ Here is the call graph for this function:

Field Documentation

◆ $possible_items

array ilLPCollectionOfMediaObjects::$possible_items = array()
staticprotected

Definition at line 27 of file class.ilLPCollectionOfMediaObjects.php.

Referenced by cloneCollection().


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