Code Duplication    Length = 11-11 lines in 2 locations

class/bbctypes.class.php 1 location

@@ 397-407 (lines=11) @@
394
            }
395
        }
396
397
        if (!$error) {
398
            $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
399
            $sql .= ' WHERE idType=' . $this->id;
400
401
            $resql = $this->db->query($sql);
402
            if (!$resql) {
403
                $error++;
404
                $this->errors[] = 'Error ' . $this->db->lasterror();
405
                dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
406
            }
407
        }
408
409
        // Commit or rollback
410
        if ($error) {

class/bbcvols.class.php 1 location

@@ 548-558 (lines=11) @@
545
            }
546
        }
547
548
        if (!$error) {
549
            $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
550
            $sql .= ' WHERE idBBC_vols=' . $this->idBBC_vols;
551
552
            $resql = $this->db->query($sql);
553
            if (!$resql) {
554
                $error++;
555
                $this->errors[] = 'Error ' . $this->db->lasterror();
556
                dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
557
            }
558
        }
559
560
        // Commit or rollback
561
        if ($error) {