ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLPStatusFactory Class Reference

Class ilLPStatusFactory Creates status class instances for learning progress modes of an object. More...

+ Collaboration diagram for ilLPStatusFactory:

Static Public Member Functions

static _getClassById ($a_obj_id, $a_mode=null)
 
static _getClassByIdAndType ($a_obj_id, $a_type)
 
static _getInstance ($a_obj_id, $a_mode=null)
 

Static Protected Member Functions

static includeClass ($a_class)
 

Static Private Attributes

static $class_by_obj_id = array()
 

Detailed Description

Class ilLPStatusFactory Creates status class instances for learning progress modes of an object.

E.g obj_id of course returns an instance of ilLPStatusManual, ilLPStatusObjectives ...

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 19 of file class.ilLPStatusFactory.php.

Member Function Documentation

◆ _getClassById()

static ilLPStatusFactory::_getClassById (   $a_obj_id,
  $a_mode = null 
)
static

Definition at line 23 of file class.ilLPStatusFactory.php.

24 {
25 if ($a_mode === null) {
26 include_once 'Services/Object/classes/class.ilObjectLP.php';
27 $olp = ilObjectLP::getInstance($a_obj_id);
28 $a_mode = $olp->getCurrentMode();
29
30 // please keep the cache in this if-block, otherwise default values
31 // will not trigger the include_once calls
32 if (isset(self::$class_by_obj_id[$a_obj_id])) {
33 return self::$class_by_obj_id[$a_obj_id];
34 }
35 }
36
38
39 if (array_key_exists($a_mode, $map)) {
40 $class = $map[$a_mode];
41
42 // undefined? try object lp directly
43 if ($class === null) {
44 include_once 'Services/Object/classes/class.ilObjectLP.php';
45 $olp = ilObjectLP::getInstance($a_obj_id);
46 $mode = $olp->getCurrentMode();
48 return self::_getClassById($a_obj_id, $mode);
49 }
50 } else {
51 self::includeClass($class);
52 self::$class_by_obj_id[$a_obj_id] = $class;
53 return $class;
54 }
55 }
56
57 // we probably can do better
58 echo "ilLPStatusFactory: unknown type " . $a_mode;
59 exit;
60 }
static includeClass($a_class)
static _getClassById($a_obj_id, $a_mode=null)
static getInstance($a_obj_id)
exit
Definition: login.php:29

References _getClassById(), exit, ilLPObjSettings\getClassMap(), ilObjectLP\getInstance(), includeClass(), and ilLPObjSettings\LP_MODE_UNDEFINED.

Referenced by _getClassById(), ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), ilLPStatusWrapper\_getNotAttempted(), ilLPStatusWrapper\_getStatusInfo(), ilLPStatusWrapper\_getTypicalLearningTime(), ilLPStatusWrapper\_lookupCompletedForObject(), ilLPStatusWrapper\_lookupFailedForObject(), ilLPStatusWrapper\_lookupInProgressForObject(), ilLMExplorerGUI\checkLPIcon(), ilTrQuery\getParticipantsForObject(), ilLearningProgressGUI\initCollectionManualForm(), ilLearningProgressGUI\showtlt(), ilTrackingTest\testLPMarks(), and ilLearningProgressGUI\updateManual().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getClassByIdAndType()

static ilLPStatusFactory::_getClassByIdAndType (   $a_obj_id,
  $a_type 
)
static

Definition at line 70 of file class.ilLPStatusFactory.php.

71 {
72 // id is ignored in the moment
73 switch ($a_type) {
74 case 'event':
75 self::includeClass('ilLPStatusEvent');
76 return 'ilLPStatusEvent';
77
78 default:
79 echo "ilLPStatusFactory: unknown type: " . $a_type;
80 exit;
81 }
82 }
$a_type
Definition: workflow.php:92

References $a_type, exit, and includeClass().

Referenced by ilLPStatusWrapper\_getCompletedByType(), ilLPStatusWrapper\_getFailedByType(), ilLPStatusWrapper\_getInProgressByType(), ilLPStatusWrapper\_getNotAttemptedByType(), and ilLPStatusWrapper\_getStatusInfoByType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getInstance()

static ilLPStatusFactory::_getInstance (   $a_obj_id,
  $a_mode = null 
)
static

Definition at line 84 of file class.ilLPStatusFactory.php.

85 {
86 if ($a_mode === null) {
87 include_once 'Services/Object/classes/class.ilObjectLP.php';
88 $olp = ilObjectLP::getInstance($a_obj_id);
89 $a_mode = $olp->getCurrentMode();
90 }
91
93
94 if (array_key_exists($a_mode, $map)) {
95 $class = $map[$a_mode];
96
97 // undefined? try object lp directly
98 if ($class === null) {
99 include_once 'Services/Object/classes/class.ilObjectLP.php';
100 $olp = ilObjectLP::getInstance($a_obj_id);
101 $mode = $olp->getCurrentMode();
103 return self::_getInstance($a_obj_id, $mode);
104 }
105 } else {
106 self::includeClass($class);
107 return new $class($a_obj_id);
108 }
109 }
110
111 // we probably can do better
112 echo "ilLPStatusFactory: unknown type " . $a_mode;
113 exit;
114 }
static _getInstance($a_obj_id, $a_mode=null)

References _getInstance(), exit, ilLPObjSettings\getClassMap(), ilObjectLP\getInstance(), includeClass(), and ilLPObjSettings\LP_MODE_UNDEFINED.

Referenced by ilLPStatusWrapper\_determineStatus(), _getInstance(), ilLPStatusWrapper\_refreshStatus(), ilLPStatusWrapper\_setDirty(), ilLPStatusWrapper\_updateStatus(), ilLPStatus\checkStatusForObject(), ilTrQuery\getObjectIds(), and ilTestLP\resetCustomLPDataForUserIds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ includeClass()

static ilLPStatusFactory::includeClass (   $a_class)
staticprotected

Definition at line 62 of file class.ilLPStatusFactory.php.

63 {
64 $path = ($a_class == 'ilLPStatus')
65 ? 'Services/Tracking/classes/'
66 : 'Services/Tracking/classes/status/';
67 include_once $path . 'class.' . $a_class . '.php';
68 }

Referenced by _getClassById(), _getClassByIdAndType(), and _getInstance().

+ Here is the caller graph for this function:

Field Documentation

◆ $class_by_obj_id

ilLPStatusFactory::$class_by_obj_id = array()
staticprivate

Definition at line 21 of file class.ilLPStatusFactory.php.


The documentation for this class was generated from the following file: