5 include_once
'Services/Tracking/classes/class.ilLPObjSettings.php';
35 if (!self::$instance) {
36 self::$instance =
new self();
38 return self::$instance;
49 $this->logger = $DIC->logger()->trac();
68 if ($a_mode === null) {
69 include_once
'Services/Object/classes/class.ilObjectLP.php';
71 $a_mode = $olp->getCurrentMode();
75 if (isset(self::$class_by_obj_id[$a_obj_id])) {
76 return self::$class_by_obj_id[$a_obj_id];
82 if (array_key_exists($a_mode, $map)) {
83 $class = $map[$a_mode];
86 if ($class === null) {
87 include_once
'Services/Object/classes/class.ilObjectLP.php';
89 $mode = $olp->getCurrentMode();
91 return self::_getClassById($a_obj_id, $mode);
94 self::includeClass($class);
95 self::$class_by_obj_id[$a_obj_id] = $class;
100 $factory = self::getFactoryInstance();
101 $message =
'Unknown LP mode given: ' . $a_mode;
108 $path = ($a_class ==
'ilLPStatus')
109 ?
'Services/Tracking/classes/' 110 :
'Services/Tracking/classes/status/';
111 include_once $path .
'class.' . $a_class .
'.php';
125 self::includeClass(
'ilLPStatusEvent');
126 return 'ilLPStatusEvent';
129 $factory = self::getFactoryInstance();
130 $message =
'Unknown LP type given: ' . $a_type;
144 if ($a_mode === null) {
145 include_once
'Services/Object/classes/class.ilObjectLP.php';
147 $a_mode = $olp->getCurrentMode();
152 if (array_key_exists($a_mode, $map)) {
153 $class = $map[$a_mode];
156 if ($class === null) {
157 include_once
'Services/Object/classes/class.ilObjectLP.php';
159 $mode = $olp->getCurrentMode();
161 return self::_getInstance($a_obj_id, $mode);
164 self::includeClass($class);
165 return new $class($a_obj_id);
169 $factory = self::getFactoryInstance();
170 $message =
'Unknown LP mode given: ' . $a_mode;
static getFactoryInstance()
static includeClass($a_class)
static _getInstance($a_obj_id, $a_mode=null)
static _getClassById($a_obj_id, $a_mode=null)
__construct()
ilLPStatusFactory constructor.
Class ilLPStatusFactory Creates status class instances for learning progress modes of an object...
static _getClassByIdAndType($a_obj_id, $a_type)
Thrown for invalid LP status.
static getInstance($a_obj_id)