Code Duplication    Length = 6-6 lines in 2 locations

Infrastructure/Common/Repository/AbstractDomainRepository.php 2 locations

@@ 43-48 (lines=6) @@
40
        $this->db->begin();
41
        $resql = $this->db->query(sprintf('INSERT INTO ' . $this->tableName . '(%s) VALUES (%s)', $columns, $values));
42
43
        if (!$resql) {
44
            $lasterror = $this->db->lasterror();
45
            dol_syslog(__METHOD__ . ' ' . $lasterror, LOG_ERR);
46
            $this->db->rollback();
47
            throw new \Exception("Repository error - ".$lasterror);
48
        }
49
50
        $id = $this->db->last_insert_id($this->tableName);
51
        $this->db->commit();
@@ 89-94 (lines=6) @@
86
        $this->db->begin();
87
        $resql = $this->db->query(sprintf('UPDATE %s SET %s WHERE rowid = %s ', $this->tableName, join(',',$sqlModifications), $id));
88
89
        if (!$resql) {
90
            $lasterror = $this->db->lasterror();
91
            dol_syslog(__METHOD__ . ' ' . $lasterror, LOG_ERR);
92
            $this->db->rollback();
93
            throw new \Exception("Repository error - ".$lasterror);
94
        }
95
96
        $this->db->commit();
97
    }