ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilTestProcessLockerDb.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Modules/Test/classes/class.ilTestProcessLocker.php';
5
13{
17 protected $db;
18
22 protected $atom_query;
23
27 public function __construct(ilDBInterface $db)
28 {
29 $this->db = $db;
30 $this->atom_query = $this->db->buildAtomQuery();
31 }
32
37 {
38 $this->atom_query->addTableLock('tst_active');
39 }
40
44 protected function onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables = false)
45 {
46 $this->atom_query->addTableLock('tst_rnd_cpy');
47 $this->atom_query->addTableLock('qpl_questions');
48 $this->atom_query->addTableLock('qpl_qst_type');
49 $this->atom_query->addTableLock('tst_test_rnd_qst')->lockSequence(true);
50 $this->atom_query->addTableLock('il_plugin');
51 $this->atom_query->addTableLock('tst_active');
52
53 if ($withTaxonomyTables) {
54 $this->atom_query->addTableLock('tax_tree')->aliasName('s');
55 $this->atom_query->addTableLock('tax_tree')->aliasName('t');
56 $this->atom_query->addTableLock('tax_node_assignment');
57 }
58 }
59
64 {
65 $this->atom_query->addTableLock('tst_active');
66 }
67
71 protected function executeOperation(callable $operation)
72 {
73 $this->atom_query ->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
74 $operation();
75 });
76 $this->atom_query->run();
77 }
78
79 protected function onBeforeExecutingNamedOperation(string $operationDescriptor) : void
80 {
81 throw new RuntimeException('Operation not supported');
82 }
83
84 protected function onAfterExecutingNamedOperation(string $operationDescriptor) : void
85 {
86 throw new RuntimeException('Operation not supported');
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
onAfterExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
executeOperation(callable $operation)
{}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilDB