@@ 145-147 (lines=3) @@ | ||
142 | $_read_fields[] = '*'; |
|
143 | } |
|
144 | $limit = null; |
|
145 | if ($this->limit > 0) { |
|
146 | $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
|
147 | } |
|
148 | $group = null; |
|
149 | if (count($this->_group_fields) > 0) { |
|
150 | $group = ' group by '.implode(', ', $this->_group_fields).' '; |
|
@@ 202-204 (lines=3) @@ | ||
199 | } |
|
200 | $update_fields = implode(', ', $updates); |
|
201 | $limit = null; |
|
202 | if ($this->limit > 0) { |
|
203 | $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
|
204 | } |
|
205 | $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
|
206 | $string = sprintf('update %1$s set %2$s %3$s %4$s', $this->_table_names[0], $update_fields, $where, $limit); |
|
207 | ||
@@ 244-246 (lines=3) @@ | ||
241 | $table = $this->_table_names[0]; |
|
242 | $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
|
243 | $limit = null; |
|
244 | if ($this->limit > 0) { |
|
245 | $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
|
246 | } |
|
247 | $string = sprintf('delete from %1$s %2$s %3$s', $table, $where, $limit); |
|
248 | ||
249 | return $string; |