ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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().

52  : ?int
53  {
54  return $this->contextId;
55  }
+ Here is the caller graph for this function:

◆ getLocker()

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

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

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().

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  }
+ 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.

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, and ILIAS\Repository\settings().

Referenced by getLocker().

65  : ?string
66  {
67  return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
68  }
+ 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.

References getLocker().

+ Here is the call graph for this function:

◆ withContextId()

ilTestProcessLockerFactory::withContextId ( int  $contextId)

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

References $contextId.

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

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: