Ensure removal of existing entries for identical department, lane, reg, and question before adding new objects in department_selfserve_vehicle_conditions_o
This commit is contained in:
@@ -53,6 +53,9 @@ class department_selfserve_vehicle_conditions_o extends db
|
||||
$question = (int)$question;
|
||||
$value = (bool)$value;
|
||||
$customer_id = $customer_id !== null ? (int)$customer_id : null;
|
||||
// Remove any existing entry for the same department, lane, reg and question
|
||||
$sql = "DELETE FROM $this->table WHERE department = $department AND lane = $lane AND reg = '$reg' AND question = $question";
|
||||
$db->query($sql);
|
||||
// Add the object
|
||||
$tmp_id = self::add_object([
|
||||
'department' => $department,
|
||||
|
||||
Reference in New Issue
Block a user