19declare(strict_types=0);
37 if (!self::$instance) {
38 self::$instance =
new self();
47 $this->
logger = $DIC->logger()->trac();
59 if ($a_mode === null) {
61 $a_mode = $olp->getCurrentMode();
64 if (isset(self::$class_by_obj_id[$a_obj_id])) {
65 return self::$class_by_obj_id[$a_obj_id];
71 if (array_key_exists($a_mode, $map)) {
72 $class = $map[$a_mode];
75 if ($class ===
null) {
77 $mode = $olp->getCurrentMode();
82 self::$class_by_obj_id[$a_obj_id] = $class;
88 $message =
'Unknown LP mode given: ' . $a_mode;
100 return 'ilLPStatusEvent';
103 $factory = self::getFactoryInstance();
104 $message =
'Unknown LP type given: ' . $a_type;
114 if ($a_mode === null) {
116 $a_mode = $olp->getCurrentMode();
121 if (array_key_exists($a_mode, $map)) {
122 $class = $map[$a_mode];
125 if ($class ===
null) {
127 $mode = $olp->getCurrentMode();
129 return self::_getInstance($a_obj_id, $mode);
132 return new $class($a_obj_id);
136 $factory = self::getFactoryInstance();
137 $message =
'Unknown LP mode given: ' . $a_mode;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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('../ilias.ini.php'))