ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestProcessLockerFactory Class Reference
+ Collaboration diagram for ilTestProcessLockerFactory:

Public Member Functions

 __construct (ilSetting $settings, ilDBInterface $db)
 
 getContextId ()
 
 withContextId (int $contextId)
 
 getLocker ()
 
 retrieveLockerForNamedOperation ()
 

Protected Attributes

 $settings
 
 $db
 
 $contextId
 

Private Member Functions

 getLockModeSettingValue ()
 

Detailed Description

Definition at line 16 of file class.ilTestProcessLockerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestProcessLockerFactory::__construct ( ilSetting  $settings,
ilDBInterface  $db 
)
Parameters
ilSetting$settings
ilDBInterface$db

Definition at line 37 of file class.ilTestProcessLockerFactory.php.

References $db, $settings, and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getContextId()

ilTestProcessLockerFactory::getContextId ( )

Definition at line 43 of file class.ilTestProcessLockerFactory.php.

References $contextId.

Referenced by getLocker().

+ Here is the caller graph for this function:

◆ getLocker()

ilTestProcessLockerFactory::getLocker ( )
Returns
ilTestProcessLockerDb|ilTestProcessLockerFile|ilTestProcessLockerNone

Definition at line 64 of file class.ilTestProcessLockerFactory.php.

65 {
66 switch ($this->getLockModeSettingValue()) {
68
69 $locker = new ilTestProcessLockerNone();
70 break;
71
73
74 $storage = new ilTestProcessLockFileStorage((int) $this->getContextId());
75 $storage->create();
76
77 $locker = new ilTestProcessLockerFile($storage);
78 break;
79
81
82 $locker = new ilTestProcessLockerDb($this->db);
83 break;
84 }
85
86 return $locker;
87 }

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_DB, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_FILE, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, getContextId(), and getLockModeSettingValue().

Referenced by retrieveLockerForNamedOperation().

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

◆ getLockModeSettingValue()

ilTestProcessLockerFactory::getLockModeSettingValue ( )
private

Definition at line 56 of file class.ilTestProcessLockerFactory.php.

57 {
58 return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
59 }

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, and settings().

Referenced by getLocker().

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

◆ retrieveLockerForNamedOperation()

ilTestProcessLockerFactory::retrieveLockerForNamedOperation ( )

Definition at line 89 of file class.ilTestProcessLockerFactory.php.

90 {
91 if ($this->getLocker() instanceof ilTestProcessLockerFile) {
92 return $this->getLocker();
93 }
94
95 return new ilTestProcessLockerNone();
96 }

References getLocker().

+ Here is the call graph for this function:

◆ withContextId()

ilTestProcessLockerFactory::withContextId ( int  $contextId)

Definition at line 48 of file class.ilTestProcessLockerFactory.php.

48 : self
49 {
50 $clone = clone $this;
51 $clone->contextId = $contextId;
52
53 return $clone;
54 }

References $contextId.

Field Documentation

◆ $contextId

ilTestProcessLockerFactory::$contextId
protected

Definition at line 31 of file class.ilTestProcessLockerFactory.php.

Referenced by getContextId(), and withContextId().

◆ $db

ilTestProcessLockerFactory::$db
protected

Definition at line 26 of file class.ilTestProcessLockerFactory.php.

Referenced by __construct().

◆ $settings

ilTestProcessLockerFactory::$settings
protected

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

Referenced by __construct().


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