3declare(strict_types=0);
23 if (!self::$instance) {
24 self::$instance =
new self();
33 $this->
logger = $DIC->logger()->trac();
45 if ($a_mode === null) {
47 $a_mode = $olp->getCurrentMode();
50 if (isset(self::$class_by_obj_id[$a_obj_id])) {
51 return self::$class_by_obj_id[$a_obj_id];
57 if (array_key_exists($a_mode, $map)) {
58 $class = $map[$a_mode];
61 if ($class ===
null) {
63 $mode = $olp->getCurrentMode();
68 self::$class_by_obj_id[$a_obj_id] = $class;
74 $message =
'Unknown LP mode given: ' . $a_mode;
86 return 'ilLPStatusEvent';
89 $factory = self::getFactoryInstance();
90 $message =
'Unknown LP type given: ' . $a_type;
100 if ($a_mode === null) {
102 $a_mode = $olp->getCurrentMode();
107 if (array_key_exists($a_mode, $map)) {
108 $class = $map[$a_mode];
111 if ($class ===
null) {
113 $mode = $olp->getCurrentMode();
115 return self::_getInstance($a_obj_id, $mode);
118 return new $class($a_obj_id);
122 $factory = self::getFactoryInstance();
123 $message =
'Unknown LP mode given: ' . $a_mode;
Thrown for invalid LP status.
Class ilLPStatusFactory Creates status class instances for learning progress modes of an object.
static array $class_by_obj_id
static _getInstance(int $a_obj_id, ?int $a_mode=null)
static _getClassByIdAndType(int $a_obj_id, string $a_type)
static _getClassById(int $a_obj_id, ?int $a_mode=null)
static getFactoryInstance()
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
Component logger with individual log levels by component id.
static getInstance(int $obj_id)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...