Confirm the right behavior of user with deleted_at value #1073
Answered
by
kenjis
EliMariaaaa
asked this question in
Q&A
|
I created an activate/deactivate functionality for users. I used the soft delete functionality for deactivation. However, when I try to activate the user, it's not shown when called in |
Answered by
kenjis
Mar 22, 2024
Replies: 1 comment
What did you created?
What do you mean? If you use CI4 Model's soft delete feature, it deletes records logically. |
0 replies
Answer selected by
EliMariaaaa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you created?
What do you mean?
If you use CI4 Model's soft delete feature, it deletes records logically.
If a record has
deleted_atdatetime, the record is treated as deleted.So
$users->findById([user_id])returns null.See https://codeigniter4.github.io/CodeIgniter4/models/model.html#usesoftdeletes