1 | <?php |
||
20 | class Update extends AbstractDmlQuery implements UpdateInterface |
||
21 | { |
||
22 | /** |
||
23 | * |
||
24 | * The table to update. |
||
25 | * |
||
26 | * @var string |
||
27 | * |
||
28 | */ |
||
29 | protected $table; |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * Sets the table to update. |
||
34 | * |
||
35 | * @param string $table The table to update. |
||
36 | * |
||
37 | * @return $this |
||
38 | * |
||
39 | */ |
||
40 | 18 | public function table($table) |
|
45 | |||
46 | /** |
||
47 | * |
||
48 | * Builds this query object into a string. |
||
49 | * |
||
50 | * @return string |
||
51 | * |
||
52 | */ |
||
53 | 16 | protected function build() |
|
64 | |||
65 | /** |
||
66 | * |
||
67 | * Builds the table clause. |
||
68 | * |
||
69 | * @return null |
||
70 | * |
||
71 | */ |
||
72 | 16 | protected function buildTable() |
|
76 | |||
77 | /** |
||
78 | * |
||
79 | * Adds a WHERE condition to the query by AND. If the condition has |
||
80 | * ?-placeholders, additional arguments to the method will be bound to |
||
81 | * those placeholders sequentially. |
||
82 | * |
||
83 | * @param string $cond The WHERE condition. |
||
84 | * @param mixed ...$bind arguments to bind to placeholders |
||
85 | * |
||
86 | * @return $this |
||
87 | * |
||
88 | */ |
||
89 | 15 | public function where($cond) |
|
94 | |||
95 | /** |
||
96 | * |
||
97 | * Adds a WHERE condition to the query by OR. If the condition has |
||
98 | * ?-placeholders, additional arguments to the method will be bound to |
||
99 | * those placeholders sequentially. |
||
100 | * |
||
101 | * @param string $cond The WHERE condition. |
||
102 | * @param mixed ...$bind arguments to bind to placeholders |
||
103 | * |
||
104 | * @return $this |
||
105 | * |
||
106 | * @see where() |
||
107 | * |
||
108 | */ |
||
109 | 14 | public function orWhere($cond) |
|
114 | |||
115 | /** |
||
116 | * |
||
117 | * Sets one column value placeholder; if an optional second parameter is |
||
118 | * passed, that value is bound to the placeholder. |
||
119 | * |
||
120 | * @param string $col The column name. |
||
121 | * |
||
122 | * @return $this |
||
123 | * |
||
124 | */ |
||
125 | 6 | public function col($col) |
|
129 | |||
130 | /** |
||
131 | * |
||
132 | * Sets multiple column value placeholders. If an element is a key-value |
||
133 | * pair, the key is treated as the column name and the value is bound to |
||
134 | * that column. |
||
135 | * |
||
136 | * @param array $cols A list of column names, optionally as key-value |
||
137 | * pairs where the key is a column name and the value is a bind value for |
||
138 | * that column. |
||
139 | * |
||
140 | * @return $this |
||
141 | * |
||
142 | */ |
||
143 | 15 | public function cols(array $cols) |
|
147 | |||
148 | /** |
||
149 | * |
||
150 | * Sets a column value directly; the value will not be escaped, although |
||
151 | * fully-qualified identifiers in the value will be quoted. |
||
152 | * |
||
153 | * @param string $col The column name. |
||
154 | * |
||
155 | * @param string $value The column value expression. |
||
156 | * |
||
157 | * @return $this |
||
158 | * |
||
159 | */ |
||
160 | 14 | public function set($col, $value) |
|
164 | |||
165 | /** |
||
166 | * |
||
167 | * Builds the updated columns and values of the statement. |
||
168 | * |
||
169 | * @return string |
||
170 | * |
||
171 | */ |
||
172 | 16 | protected function buildValuesForUpdate() |
|
180 | |||
181 | /** |
||
182 | * Clear some part of the query |
||
183 | * |
||
184 | * @param $part |
||
185 | * @return $this |
||
186 | */ |
||
187 | public function clear($part) |
||
210 | } |
||
211 |