Skip to content

Commit 7e6e293

Browse files
committed
Add validation to prevent soft-delete all records if conditions not set
1 parent a9db987 commit 7e6e293

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

system/Model.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,13 @@ public function insert($data = null, bool $returnID = true)
715715
$result = $this->builder()
716716
->set($data['data'], '', $escape)
717717
->insert();
718-
718+
719719
// If insertion succeeded then save the insert ID
720720
if ($result)
721721
{
722722
$this->insertID = $this->db->insertID();
723723
}
724-
724+
725725
$this->trigger('afterInsert', ['data' => $originalData, 'result' => $result]);
726726

727727
// If insertion failed, get out of here
@@ -957,8 +957,8 @@ public function purgeDeleted()
957957
}
958958

959959
return $this->builder()
960-
->where($this->table . '.' . $this->deletedField . ' IS NOT NULL')
961-
->delete();
960+
->where($this->table . '.' . $this->deletedField . ' IS NOT NULL')
961+
->delete();
962962
}
963963

964964
//--------------------------------------------------------------------
@@ -991,7 +991,7 @@ public function onlyDeleted()
991991
$this->tempUseSoftDeletes = false;
992992

993993
$this->builder()
994-
->where($this->table . '.' . $this->deletedField . ' IS NOT NULL');
994+
->where($this->table . '.' . $this->deletedField . ' IS NOT NULL');
995995

996996
return $this;
997997
}

0 commit comments

Comments
 (0)