ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 require_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 }
global $ilDB
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
executeOperation(callable $operation)
{}