3 declare(strict_types=0);
23 if (!self::$instance) {
24 self::$instance =
new self();
26 return self::$instance;
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();
65 return self::_getClassById($a_obj_id, $mode);
68 self::$class_by_obj_id[$a_obj_id] = $class;
73 $factory = self::getFactoryInstance();
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;
static getFactoryInstance()
Class ilLPStatusFactory Creates status class instances for learning progress modes of an object...
static _getClassByIdAndType(int $a_obj_id, string $a_type)
static array $class_by_obj_id
static _getClassById(int $a_obj_id, ?int $a_mode=null)
static _getInstance(int $a_obj_id, ?int $a_mode=null)
Thrown for invalid LP status.
static getInstance(int $obj_id)