1 | <?php |
||
20 | class Update extends AbstractDmlQuery implements UpdateInterface |
||
21 | { |
||
22 | use WhereTrait; |
||
23 | |||
24 | /** |
||
25 | * |
||
26 | * The table to update. |
||
27 | * |
||
28 | * @var string |
||
29 | * |
||
30 | */ |
||
31 | protected $table; |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | * Sets the table to update. |
||
36 | * |
||
37 | * @param string $table The table to update. |
||
38 | * |
||
39 | * @return $this |
||
40 | * |
||
41 | */ |
||
42 | 18 | public function table($table) |
|
47 | |||
48 | /** |
||
49 | * |
||
50 | * Builds this query object into a string. |
||
51 | * |
||
52 | * @return string |
||
53 | * |
||
54 | */ |
||
55 | 16 | protected function build() |
|
66 | |||
67 | /** |
||
68 | * |
||
69 | * Builds the table clause. |
||
70 | * |
||
71 | * @return null |
||
72 | * |
||
73 | */ |
||
74 | 16 | protected function buildTable() |
|
78 | |||
79 | /** |
||
80 | * |
||
81 | * Sets one column value placeholder; if an optional second parameter is |
||
82 | * passed, that value is bound to the placeholder. |
||
83 | * |
||
84 | * @param string $col The column name. |
||
85 | * |
||
86 | * @param array $value |
||
87 | * |
||
88 | * @return $this |
||
89 | */ |
||
90 | 6 | public function col($col, ...$value) |
|
94 | |||
95 | /** |
||
96 | * |
||
97 | * Sets multiple column value placeholders. If an element is a key-value |
||
98 | * pair, the key is treated as the column name and the value is bound to |
||
99 | * that column. |
||
100 | * |
||
101 | * @param array $cols A list of column names, optionally as key-value |
||
102 | * pairs where the key is a column name and the value is a bind value for |
||
103 | * that column. |
||
104 | * |
||
105 | * @return $this |
||
106 | * |
||
107 | */ |
||
108 | 15 | public function cols(array $cols) |
|
112 | |||
113 | /** |
||
114 | * |
||
115 | * Sets a column value directly; the value will not be escaped, although |
||
116 | * fully-qualified identifiers in the value will be quoted. |
||
117 | * |
||
118 | * @param string $col The column name. |
||
119 | * |
||
120 | * @param string $value The column value expression. |
||
121 | * |
||
122 | * @return $this |
||
123 | * |
||
124 | */ |
||
125 | 14 | public function set($col, $value) |
|
129 | |||
130 | /** |
||
131 | * |
||
132 | * Builds the updated columns and values of the statement. |
||
133 | * |
||
134 | * @return string |
||
135 | * |
||
136 | */ |
||
137 | 16 | protected function buildValuesForUpdate() |
|
145 | } |
||
146 |