|
@@ 155-157 (lines=3) @@
|
| 152 |
|
$_read_fields[] = '*'; |
| 153 |
|
} |
| 154 |
|
$limit = null; |
| 155 |
|
if ($this->limit > 0) { |
| 156 |
|
$limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
| 157 |
|
} |
| 158 |
|
$group = null; |
| 159 |
|
if (count($this->_group_fields) > 0) { |
| 160 |
|
$group = ' group by '.implode(', ', $this->_group_fields).' '; |
|
@@ 212-214 (lines=3) @@
|
| 209 |
|
} |
| 210 |
|
$update_fields = implode(', ', $updates); |
| 211 |
|
$limit = null; |
| 212 |
|
if ($this->limit > 0) { |
| 213 |
|
$limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
| 214 |
|
} |
| 215 |
|
$where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
| 216 |
|
$string = sprintf('update %1$s set %2$s %3$s %4$s', $this->_table_names[0], $update_fields, $where, $limit); |
| 217 |
|
|
|
@@ 254-256 (lines=3) @@
|
| 251 |
|
$table = $this->_table_names[0]; |
| 252 |
|
$where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
| 253 |
|
$limit = null; |
| 254 |
|
if ($this->limit > 0) { |
| 255 |
|
$limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
| 256 |
|
} |
| 257 |
|
$string = sprintf('delete from %1$s %2$s %3$s', $table, $where, $limit); |
| 258 |
|
|
| 259 |
|
return $string; |