How Cancel The Delete in ‘’$useSoftDeletes = true‘’ |
in Models set:
protected $useSoftDeletes = true; when some items was deleted like : itemModel->delete([1,2,3]); Then , we need cancle this. has any function like unDelete() ....
Set the `deleted_at` value to `null` for the records you want to un-delete.
07-27-2022, 11:28 PM
(This post was last modified: 07-27-2022, 11:31 PM by ozornick. Edit Reason: Add info )
Yesterday I ran into this situation. If you set the entity $user->deletedAt = null, it may not be able to update the entry. It says "No data to update"
The $user->hasChanged() method returns true. If you make a request using QB $model->set(deleted_at, null)->update(id), it also fails to save
(07-27-2022, 11:28 PM)ozornick Wrote: Yesterday I ran into this situation. If you set the entity $user->deletedAt = null, it may not be able to update the entry. It says "No data to update" I am running into this same issue, were you able to solve it?
IF you think it's a bug then leave an issue on the CodeIgniter GitHub Development.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |