Code Duplication    Length = 3-4 lines in 2 locations

src/Intraface/modules/procurement/ProcurementItem.php 1 location

@@ 297-299 (lines=3) @@
294
        if ($this->id == 0) {
295
            $db->query("INSERT INTO procurement_item SET " . $sql . ", intranet_id = " . $this->procurement->kernel->intranet->get("id") . ", procurement_id = " . $this->procurement->get("id") . ", active = 1");
296
            $this->id = $db->InsertedId();
297
        } else {
298
            $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id"));
299
        }
300
301
        return $this->id;
302
    }

src/Intraface/modules/filemanager/FileHandler.php 1 location

@@ 602-605 (lines=4) @@
599
600
        if ($this->id != 0) {
601
            $db->query("UPDATE file_handler SET ".implode(', ', $sql)." WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id);
602
        } else {
603
            $db->query("INSERT INTO file_handler SET ".implode(', ', $sql).", user_id = ".$this->kernel->user->get('id').", intranet_id = ".$this->kernel->intranet->get('id').", date_created = NOW()");
604
            $this->id = $db->insertedId();
605
        }
606
607
        $this->load();
608