Request for Soft Delete to not touch or change the updatedField - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: Request for Soft Delete to not touch or change the updatedField (/showthread.php?tid=87755) |
Request for Soft Delete to not touch or change the updatedField - jinbatsu - 05-29-2023 Currently I'm seeing that while deleting with soft delete, it also change the updatedField date. So the actual updatedField date is replaced by Soft Delete. /system/Model.php line: 449-551 PHP Code: if ($this->useTimestamps && $this->updatedField) { And also, for insert data, it should be only fill createdField only, the updatedField should be NULL. /system/BaseModel.php line: 772-774 PHP Code: if ($this->useTimestamps && $this->updatedField && ! array_key_exists($this->updatedField, $data)) { Meanwhile, I commented those line, so that updatedField is in actual date. I hope this can be implement in the next version. Thanks RE: Request for Soft Delete to not touch or change the updatedField - jinbatsu - 05-30-2023 I finally use custome base model which can solve this case. PHP Code: protected function cbBeforeInsert(array $data) { So, I'm not depend on /system/ files, to stay update |