Code Duplication    Length = 17-17 lines in 2 locations

includes/libraries/Database/Meekrodb/db.class.php 2 locations

@@ 276-292 (lines=17) @@
273
    return $this->nested_transactions_count;
274
    }
275
276
    public function commit($all = false) {
277
    if ($this->nested_transactions && $this->serverVersion() < '5.5') {
278
        return $this->nonSQLError("Nested transactions are only available on MySQL 5.5 and greater. You are using MySQL ".$this->serverVersion());
279
    }
280
281
    if ($this->nested_transactions && $this->nested_transactions_count > 0) {
282
            $this->nested_transactions_count--;
283
    }
284
285
    if (!$this->nested_transactions || $all || $this->nested_transactions_count == 0) {
286
        $this->nested_transactions_count = 0;
287
        $this->query('COMMIT');
288
    } else {
289
        $this->query("RELEASE SAVEPOINT LEVEL{$this->nested_transactions_count}");
290
    }
291
292
    return $this->nested_transactions_count;
293
    }
294
295
    public function rollback($all = false) {
@@ 295-311 (lines=17) @@
292
    return $this->nested_transactions_count;
293
    }
294
295
    public function rollback($all = false) {
296
    if ($this->nested_transactions && $this->serverVersion() < '5.5') {
297
        return $this->nonSQLError("Nested transactions are only available on MySQL 5.5 and greater. You are using MySQL ".$this->serverVersion());
298
    }
299
300
    if ($this->nested_transactions && $this->nested_transactions_count > 0) {
301
            $this->nested_transactions_count--;
302
    }
303
304
    if (!$this->nested_transactions || $all || $this->nested_transactions_count == 0) {
305
        $this->nested_transactions_count = 0;
306
        $this->query('ROLLBACK');
307
    } else {
308
        $this->query("ROLLBACK TO SAVEPOINT LEVEL{$this->nested_transactions_count}");
309
    }
310
311
    return $this->nested_transactions_count;
312
    }
313
314
    protected function formatTableName($table) {