ILIAS  release_8 Revision v8.24
class.ilTableLock.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
26{
27 protected string $table_name = '';
28 protected bool $lock_sequence = false;
29 protected string $alias = '';
31 protected bool $checked = false;
32 protected \ilDBInterface $ilDBInstance;
33
37 public function __construct(string $table_name, ilDBInterface $ilDBInterface)
38 {
39 $this->table_name = $table_name;
40 $this->ilDBInstance = $ilDBInterface;
41 }
42
46 public function check(): void
47 {
48 if (!in_array($this->getLockLevel(), [ilAtomQuery::LOCK_READ, ilAtomQuery::LOCK_WRITE], true)) {
50 }
51 if (!$this->getTableName() || !$this->ilDBInstance->tableExists($this->getTableName())) {
53 }
54
55 $this->setChecked(true);
56 }
57
58 public function lockSequence(bool $lock_bool): ilTableLockInterface
59 {
60 $this->setLockSequence($lock_bool);
61
62 return $this;
63 }
64
65 public function aliasName(string $alias_name): ilTableLockInterface
66 {
67 $this->setAlias($alias_name);
68
69 return $this;
70 }
71
72 public function getTableName(): string
73 {
74 return $this->table_name;
75 }
76
77 public function setTableName(string $table_name): void
78 {
79 $this->table_name = $table_name;
80 }
81
82 public function isLockSequence(): bool
83 {
85 }
86
87 public function setLockSequence(bool $lock_sequence): void
88 {
89 $this->lock_sequence = $lock_sequence;
90 }
91
92 public function getAlias(): string
93 {
94 return $this->alias;
95 }
96
97 public function setAlias(string $alias): void
98 {
99 $this->alias = $alias;
100 }
101
102 public function getLockLevel(): int
103 {
104 return $this->lock_level;
105 }
106
107 public function setLockLevel(int $lock_level): void
108 {
109 $this->lock_level = $lock_level;
110 }
111
112 public function isChecked(): bool
113 {
114 return $this->checked;
115 }
116
117 public function setChecked(bool $checked): void
118 {
119 $this->checked = $checked;
120 }
121}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
lockSequence(bool $lock_bool)
Set true/false whether you would like to lock an existing sequence-table, too Without lockSequence(tr...
setLockLevel(int $lock_level)
ilDBInterface $ilDBInstance
setLockSequence(bool $lock_sequence)
setChecked(bool $checked)
__construct(string $table_name, ilDBInterface $ilDBInterface)
ilTableLock constructor.
setAlias(string $alias)
setTableName(string $table_name)
aliasName(string $alias_name)
If you use Alias' in your Queries which have to be locked by ilAtomQuery, "LOCK TABLE" needs to lock ...
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...