ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTestProcessLockerDb.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
32 protected $db;
33
37 protected $atom_query;
38
42 public function __construct(ilDBInterface $db)
43 {
44 $this->db = $db;
45 $this->atom_query = $this->db->buildAtomQuery();
46 }
47
52 {
53 $this->atom_query->addTableLock('tst_active');
54 }
55
59 protected function onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables = false)
60 {
61 $this->atom_query->addTableLock('tst_rnd_cpy');
62 $this->atom_query->addTableLock('qpl_questions');
63 $this->atom_query->addTableLock('qpl_qst_type');
64 $this->atom_query->addTableLock('tst_test_rnd_qst')->lockSequence(true);
65 $this->atom_query->addTableLock('il_plugin');
66 $this->atom_query->addTableLock('tst_active');
67
68 if ($withTaxonomyTables) {
69 $this->atom_query->addTableLock('tax_tree')->aliasName('s');
70 $this->atom_query->addTableLock('tax_tree')->aliasName('t');
71 $this->atom_query->addTableLock('tax_node_assignment');
72 }
73 }
74
79 {
80 $this->atom_query->addTableLock('tst_active');
81 $this->atom_query->addTableLock('tst_pass_result');
82 }
83
87 protected function executeOperation(callable $operation)
88 {
89 $this->atom_query ->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
90 $operation();
91 });
92 $this->atom_query->run();
93 }
94
95 protected function onBeforeExecutingNamedOperation(string $operationDescriptor): void
96 {
97 throw new RuntimeException('Operation not supported');
98 }
99
100 protected function onAfterExecutingNamedOperation(string $operationDescriptor): void
101 {
102 throw new RuntimeException('Operation not supported');
103 }
104}
onAfterExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
executeOperation(callable $operation)
{}
Interface ilDBInterface.