ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LearningProgressManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 protected \ilObjMediaCast $media_cast;
26
28 {
29 $this->media_cast = $media_cast;
30 }
31
32 public function addItemToLP(int $mob_id): void
33 {
34 $lp = \ilObjectLP::getInstance($this->media_cast->getId());
35
36 // see ilLPListOfSettingsGUI assign
37 $collection = $lp->getCollectionInstance();
38 if (
39 $collection &&
40 $collection->hasSelectableItems() &&
41 $this->media_cast->getNewItemsInLearningProgress()
42 ) {
43 $collection->activateEntries([$mob_id]);
44 $lp->resetCaches();
45 \ilLPStatusWrapper::_refreshStatus($this->media_cast->getId());
46 }
47 }
48
49 public function isCollectionMode(): bool
50 {
51 $lp = \ilObjectLP::getInstance($this->media_cast->getId());
52 return $lp->getCurrentMode() === \ilLPObjSettings::LP_MODE_COLLECTION_MOBS;
53 }
54}
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $obj_id)