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

@@ 615-625 (lines=11) @@
612
            }
613
        }
614
615
        if (!$error) {
616
            $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
617
            $sql .= ' WHERE idBBC_vols=' . $this->idBBC_vols;
618
619
            $resql = $this->db->query($sql);
620
            if (!$resql) {
621
                $error++;
622
                $this->errors[] = 'Error ' . $this->db->lasterror();
623
                dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
624
            }
625
        }
626
627
        // Commit or rollback
628
        if ($error) {