|
@@ 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).' '; |
|
@@ 196-198 (lines=3) @@
|
| 193 |
|
} |
| 194 |
|
$update_fields = implode(', ', $updates); |
| 195 |
|
$limit = null; |
| 196 |
|
if ($this->limit > 0) { |
| 197 |
|
$limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
| 198 |
|
} |
| 199 |
|
$where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
| 200 |
|
$string = sprintf('update %1$s set %2$s %3$s %4$s', $this->_table_names[0], $update_fields, $where, $limit); |
| 201 |
|
|
|
@@ 229-231 (lines=3) @@
|
| 226 |
|
$table = $this->_table_names[0]; |
| 227 |
|
$where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null; |
| 228 |
|
$limit = null; |
| 229 |
|
if ($this->limit > 0) { |
| 230 |
|
$limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit; |
| 231 |
|
} |
| 232 |
|
$string = sprintf('delete from %1$s %2$s %3$s', $table, $where, $limit); |
| 233 |
|
|
| 234 |
|
return $string; |