ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 27 of file class.ilTestProcessLockerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $contextId.

Referenced by getLocker().

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

◆ getLocker()

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

Definition at line 75 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().

76  {
77  switch ($this->getLockModeSettingValue()) {
79 
80  $locker = new ilTestProcessLockerNone();
81  break;
82 
84 
85  $storage = new ilTestProcessLockFileStorage((int) $this->getContextId());
86  $storage->create();
87 
88  $locker = new ilTestProcessLockerFile($storage);
89  break;
90 
92 
93  $locker = new ilTestProcessLockerDb($this->db);
94  break;
95  }
96 
97  return $locker;
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLockModeSettingValue()

ilTestProcessLockerFactory::getLockModeSettingValue ( )
private

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

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

Referenced by getLocker().

67  : ?string
68  {
69  return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
70  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ retrieveLockerForNamedOperation()

ilTestProcessLockerFactory::retrieveLockerForNamedOperation ( )

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

References getLocker().

+ Here is the call graph for this function:

◆ withContextId()

ilTestProcessLockerFactory::withContextId ( int  $contextId)

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

References $contextId.

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

Field Documentation

◆ $contextId

ilTestProcessLockerFactory::$contextId
protected

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

Referenced by getContextId(), and withContextId().

◆ $db

ilTestProcessLockerFactory::$db
protected

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

Referenced by __construct().

◆ $settings

ilTestProcessLockerFactory::$settings
protected

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

Referenced by __construct().


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