ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestProcessLockerDb.php
Go to the documentation of this file.
1 <?php
2 
26 {
30  protected $db;
31 
35  protected $atom_query;
36 
40  public function __construct(ilDBInterface $db)
41  {
42  $this->db = $db;
43  $this->atom_query = $this->db->buildAtomQuery();
44  }
45 
50  {
51  $this->atom_query->addTableLock('tst_active');
52  }
53 
57  protected function onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables = false)
58  {
59  $this->atom_query->addTableLock('tst_rnd_cpy');
60  $this->atom_query->addTableLock('qpl_questions');
61  $this->atom_query->addTableLock('qpl_qst_type');
62  $this->atom_query->addTableLock('tst_test_rnd_qst')->lockSequence(true);
63  $this->atom_query->addTableLock('il_plugin');
64  $this->atom_query->addTableLock('tst_active');
65 
66  if ($withTaxonomyTables) {
67  $this->atom_query->addTableLock('tax_tree')->aliasName('s');
68  $this->atom_query->addTableLock('tax_tree')->aliasName('t');
69  $this->atom_query->addTableLock('tax_node_assignment');
70  }
71  }
72 
77  {
78  $this->atom_query->addTableLock('tst_active');
79  }
80 
84  protected function executeOperation(callable $operation)
85  {
86  $this->atom_query ->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
87  $operation();
88  });
89  $this->atom_query->run();
90  }
91 
92  protected function onBeforeExecutingNamedOperation(string $operationDescriptor): void
93  {
94  throw new RuntimeException('Operation not supported');
95  }
96 
97  protected function onAfterExecutingNamedOperation(string $operationDescriptor): void
98  {
99  throw new RuntimeException('Operation not supported');
100  }
101 }
onBeforeExecutingNamedOperation(string $operationDescriptor)
onAfterExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
executeOperation(callable $operation)
{}