forked from phpmyadmin/sql-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTruncateStatement.php
More file actions
35 lines (29 loc) · 836 Bytes
/
Copy pathTruncateStatement.php
File metadata and controls
35 lines (29 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Statements;
use PhpMyAdmin\SqlParser\Components\Expression;
use PhpMyAdmin\SqlParser\Statement;
/**
* `TRUNCATE` statement.
*/
class TruncateStatement extends Statement
{
/**
* Options for `TRUNCATE` statements.
*
* @var array<string, int|array<int, int|string>>
* @psalm-var array<string, (positive-int|array{positive-int, ('var'|'var='|'expr'|'expr=')})>
*/
public static array $statementOptions = ['TABLE' => 1];
/**
* The name of the truncated table.
*/
public Expression|null $table = null;
/**
* Special build method for truncate statement as Statement::build would return empty string.
*/
public function build(): string
{
return 'TRUNCATE TABLE ' . $this->table . ';';
}
}