ILIAS  release_8 Revision v8.24
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 25 of file class.ilTestProcessLockerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $db, $settings, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getContextId()

ilTestProcessLockerFactory::getContextId ( )

Definition at line 52 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 73 of file class.ilTestProcessLockerFactory.php.

74 {
75 switch ($this->getLockModeSettingValue()) {
77
78 $locker = new ilTestProcessLockerNone();
79 break;
80
82
83 $storage = new ilTestProcessLockFileStorage((int) $this->getContextId());
84 $storage->create();
85
86 $locker = new ilTestProcessLockerFile($storage);
87 break;
88
90
91 $locker = new ilTestProcessLockerDb($this->db);
92 break;
93 }
94
95 return $locker;
96 }

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 65 of file class.ilTestProcessLockerFactory.php.

65 : ?string
66 {
67 return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
68 }

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, and ILIAS\Repository\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 98 of file class.ilTestProcessLockerFactory.php.

99 {
100 if ($this->getLocker() instanceof ilTestProcessLockerFile) {
101 return $this->getLocker();
102 }
103
104 return new ilTestProcessLockerNone();
105 }

References getLocker().

+ Here is the call graph for this function:

◆ withContextId()

ilTestProcessLockerFactory::withContextId ( int  $contextId)

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

57 : self
58 {
59 $clone = clone $this;
60 $clone->contextId = $contextId;
61
62 return $clone;
63 }

References $contextId.

Field Documentation

◆ $contextId

ilTestProcessLockerFactory::$contextId
protected

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

Referenced by getContextId(), and withContextId().

◆ $db

ilTestProcessLockerFactory::$db
protected

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

Referenced by __construct().

◆ $settings

ilTestProcessLockerFactory::$settings
protected

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

Referenced by __construct().


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