Code Duplication    Length = 3-3 lines in 3 locations

src/qb.php 3 locations

@@ 143-145 (lines=3) @@
140
            $_read_fields[] = '*';
141
        }
142
        $limit = null;
143
        if ($this->limit > 0) {
144
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
145
        }
146
        $group = null;
147
        if (count($this->_group_fields) > 0) {
148
            $group = ' group by '.implode(', ', $this->_group_fields).' ';
@@ 194-196 (lines=3) @@
191
        }
192
        $update_fields = implode(', ', $updates);
193
        $limit = null;
194
        if ($this->limit > 0) {
195
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
196
        }
197
        $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null;
198
        $string = sprintf('update %1$s set %2$s %3$s %4$s', $this->_table_names[0], $update_fields, $where, $limit);
199
@@ 227-229 (lines=3) @@
224
        $table = $this->_table_names[0];
225
        $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null;
226
        $limit = null;
227
        if ($this->limit > 0) {
228
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
229
        }
230
        $string = sprintf('delete from %1$s %2$s %3$s', $table, $where, $limit);
231
232
        return $string;