classTableLock
final class TableLock
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One table LOCK TABLES locks: t [[AS] alias] lock_type.
The statement that holds it records the resolution of the table name as the relation fact of this node. A table locked under an alias is reached by later statements of the session only through that alias. Source: https://dev.mysql.com/doc/refman/8.4/en/lock-tables.html.
$lock = new \SqlSemantics\Platform\MySql\Statement\Server\Lock\TableLock(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('t')), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('a'), \SqlSemantics\Platform\MySql\Statement\Server\Lock\LockMode::Write);
[$lock->table->name->value, $lock->alias?->value, $lock->mode] // => ['t', 'a', \SqlSemantics\Platform\MySql\Statement\Server\Lock\LockMode::Write]Properties§
public QualifiedName $tablepublic Name|null $aliaspublic LockMode $modepublic AliasMark $mark = AliasMark::AsMethods§
public function __construct(
public QualifiedName $table,
public Name|null $alias,
public LockMode $mode,
public AliasMark $mark = AliasMark::As,
)Parameters
$table | QualifiedName | The table name with its optional database |
$alias | Name|null | The alias, when written |
$mode | LockMode | The lock |
$mark | AliasMark | What is written before the alias |
Calls 2
- class-const AliasMark::As() line 39
- static-call Check::input() line 41
public function render(Output $out): voidWrites the table, the alias and the lock.
Parameters
$out | Output |
Calls 7
- method-call Output::name() line 51
- class-const NameUse::Qualifier() line 51
- class-const NameUse::Relation() line 53
- method-call AliasMark::write() line 55
- class-const NameUse::Alias() line 56
- method-call Output::keyword() line 58
- function-call
explodeline 58
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TableLockTestcalls