ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
55 $this->atom_query->addTableLock('tax_tree')->aliasName('s');
56 $this->atom_query->addTableLock('tax_tree')->aliasName('t');
57 $this->atom_query->addTableLock('tax_node_assignment');
58 }
59 }
60
65 {
66 $this->atom_query->addTableLock('tst_active');
67 }
68
72 protected function executeOperation(callable $operation)
73 {
74 $this->atom_query ->addQueryCallable(function(ilDBInterface $ilDB) use ($operation) {
75 $operation();
76 });
77 $this->atom_query->run();
78 }
79}
An exception for terminatinating execution or to throw for unit testing.
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
executeOperation(callable $operation)
{}
Interface ilDBInterface.
global $ilDB