ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssQuestionProcessLockerDb Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockerDb:
+ Collaboration diagram for ilAssQuestionProcessLockerDb:

Public Member Functions

 __construct (private ilDBInterface $db)
 
- Public Member Functions inherited from ilAssQuestionProcessLocker
 executePersistWorkingStateLockOperation (callable $operation)
 
 executeUserSolutionUpdateLockOperation (callable $operation)
 
 executeUserQuestionResultUpdateOperation (callable $operation)
 
 executeUserPassResultUpdateLockOperation (callable $operation)
 
 executeUserTestResultUpdateLockOperation (callable $operation)
 
 executeUserSolutionAdoptLockOperation (callable $operation)
 

Protected Member Functions

 onBeforeExecutingUserSolutionUpdateOperation ()
 
 onBeforeExecutingUserQuestionResultUpdateOperation ()
 
 onBeforeExecutingUserSolutionAdoptOperation ()
 
 onBeforeExecutingUserTestResultUpdateOperation ()
 
 executeOperation (callable $operation)
 
- Protected Member Functions inherited from ilAssQuestionProcessLocker
 executeOperation (callable $operation)
 
 onBeforeExecutingPersistWorkingStateOperation ()
 
 onAfterExecutingPersistWorkingStateOperation ()
 
 onBeforeExecutingUserSolutionUpdateOperation ()
 
 onBeforeExecutingUserQuestionResultUpdateOperation ()
 
 onAfterExecutingUserQuestionResultUpdateOperation ()
 
 onBeforeExecutingUserPassResultUpdateOperation ()
 
 onAfterExecutingUserPassResultUpdateOperation ()
 
 onBeforeExecutingUserTestResultUpdateOperation ()
 
 onAfterExecutingUserTestResultUpdateOperation ()
 
 onBeforeExecutingUserSolutionAdoptOperation ()
 
 onAfterExecutingUserSolutionAdoptOperation ()
 

Protected Attributes

ilAtomQuery $atom_query = null
 

Private Member Functions

 getTablesUsedDuringSolutionUpdate ()
 
 getTablesUsedDuringResultUpdate ()
 

Detailed Description

Definition at line 25 of file class.ilAssQuestionProcessLockerDb.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockerDb::__construct ( private ilDBInterface  $db)

Definition at line 29 of file class.ilAssQuestionProcessLockerDb.php.

30  {
31  $this->db = $db;
32  }

Member Function Documentation

◆ executeOperation()

ilAssQuestionProcessLockerDb::executeOperation ( callable  $operation)
protected

Definition at line 86 of file class.ilAssQuestionProcessLockerDb.php.

References $ilDB, and null.

86  : void
87  {
88  if ($this->atom_query !== null) {
89  $this->atom_query->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
90  $operation();
91  });
92  $this->atom_query->run();
93  } else {
94  $operation();
95  }
96 
97  $this->atom_query = null;
98  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getTablesUsedDuringResultUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringResultUpdate ( )
private

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

Referenced by onBeforeExecutingUserQuestionResultUpdateOperation(), and onBeforeExecutingUserSolutionAdoptOperation().

42  : array
43  {
44  return [
45  ['name' => 'tst_test_result', 'sequence' => true]
46  ];
47  }
+ Here is the caller graph for this function:

◆ getTablesUsedDuringSolutionUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringSolutionUpdate ( )
private

Definition at line 34 of file class.ilAssQuestionProcessLockerDb.php.

References PassPresentedVariablesRepo\TABLE_NAME.

Referenced by onBeforeExecutingUserSolutionAdoptOperation(), and onBeforeExecutingUserSolutionUpdateOperation().

34  : array
35  {
36  return [
37  ['name' => 'tst_solutions', 'sequence' => true],
38  ['name' => PassPresentedVariablesRepo::TABLE_NAME, 'sequence' => false]
39  ];
40  }
+ Here is the caller graph for this function:

◆ onBeforeExecutingUserQuestionResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserQuestionResultUpdateOperation ( )
protected

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

References getTablesUsedDuringResultUpdate().

59  : void
60  {
61  $this->atom_query = $this->db->buildAtomQuery();
62  foreach ($this->getTablesUsedDuringResultUpdate() as $table) {
63  $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
64  }
65  }
+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionAdoptOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionAdoptOperation ( )
protected

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

References getTablesUsedDuringResultUpdate(), and getTablesUsedDuringSolutionUpdate().

67  : void
68  {
69  $this->atom_query = $this->db->buildAtomQuery();
70  foreach (array_merge(
73  ) as $table) {
74  $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
75  }
76  }
+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionUpdateOperation ( )
protected

Definition at line 49 of file class.ilAssQuestionProcessLockerDb.php.

References getTablesUsedDuringSolutionUpdate().

49  : void
50  {
51  $tables = $this->getTablesUsedDuringSolutionUpdate();
52 
53  $this->atom_query = $this->db->buildAtomQuery();
54  foreach ($tables as $table) {
55  $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
56  }
57  }
+ Here is the call graph for this function:

◆ onBeforeExecutingUserTestResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserTestResultUpdateOperation ( )
protected

Definition at line 78 of file class.ilAssQuestionProcessLockerDb.php.

78  : void
79  {
80  $this->atom_query = $this->db->buildAtomQuery();
81  $this->atom_query->addTableLock('tst_result_cache');
82  $this->atom_query->addTableLock('tst_test_result')->lockSequence(true);
83  $this->atom_query->addTableLock('tst_solutions')->lockSequence(true);
84  }

Field Documentation

◆ $atom_query

ilAtomQuery ilAssQuestionProcessLockerDb::$atom_query = null
protected

Definition at line 27 of file class.ilAssQuestionProcessLockerDb.php.


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