forked from phpmyadmin/sql-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetStatement.php
More file actions
67 lines (59 loc) · 1.25 KB
/
SetStatement.php
File metadata and controls
67 lines (59 loc) · 1.25 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* `SET` statement.
*/
namespace PhpMyAdmin\SqlParser\Statements;
use PhpMyAdmin\SqlParser\Components\OptionsArray;
use PhpMyAdmin\SqlParser\Components\SetOperation;
use PhpMyAdmin\SqlParser\Statement;
/**
* `SET` statement.
*
* @category Statements
*
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
*/
class SetStatement extends Statement
{
/**
* The clauses of this statement, in order.
*
* @see Statement::$CLAUSES
*
* @var array
*/
public static $CLAUSES = array(
'SET' => array('SET', 3),
);
/**
* Possible exceptions in SET statment.
*
* @var array
*/
public static $OPTIONS = array(
'CHARSET' => array(3, 'var'),
'CHARACTER SET' => array(3, 'var'),
'NAMES' => array(3, 'var'),
'PASSWORD' => array(3, 'expr'),
);
/**
* Options used in current statement.
*
* @var OptionsArray[]
*/
public $options;
/**
* The updated values.
*
* @var SetOperation[]
*/
public $set;
/**
* @return string
*/
public function build()
{
return 'SET ' . OptionsArray::build($this->options)
. ' ' . SetOperation::build($this->set);
}
}