ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
LockHandlerilDB.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 
9 class LockHandlerilDB implements LockHandler
10 {
14  protected $db;
15 
21  public function __construct(\ilDBInterface $db)
22  {
23  $this->db = $db;
24  }
25 
26  public function lockTables(array $table_names, callable $during) : LockHandlerResult
27  {
28  $lock = $this->db->buildAtomQuery();
29  foreach ($table_names as $table_name) {
30  $lock->addTableLock($table_name);
31  }
32  $lock->addQueryCallable(static function (\ilDBInterface $db) use ($during) {
33  $during();
34  });
35 
36  return new LockHandlerResultilDB($lock);
37  }
38 }
lockTables(array $table_names, callable $during)
__construct(\ilDBInterface $db)
LockHandlerilDB constructor.