ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
LockHandlerilDB.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 class LockHandlerilDB implements LockHandler
28 {
33  public function __construct(protected \ilDBInterface $db)
34  {
35  }
36 
37  public function lockTables(array $table_names, callable $during): LockHandlerResult
38  {
39  $lock = $this->db->buildAtomQuery();
40  foreach ($table_names as $table_name) {
41  $lock->addTableLock($table_name);
42  }
43  $lock->addQueryCallable(static function (\ilDBInterface $db) use ($during): void {
44  $during();
45  });
46 
47  return new LockHandlerResultilDB($lock);
48  }
49 }
__construct(protected \ilDBInterface $db)
LockHandlerilDB constructor.
lockTables(array $table_names, callable $during)