Welcome Guest, Not a member yet? Register   Sign In
Model Update ignores null
#3

(This post was last modified: 12-30-2021, 03:19 AM by AngelRodriguez.)

(12-29-2021, 05:43 PM)kenjis Wrote: Why customer_deleted is null and customer_deleted_at is not null?
It does not make sense. Is it soft-deleted or not?

And if you use soft-deletion, you should not change customer_deleted and customer_deleted_at like your code.


It just an example.

Forget customer_deleted. Imagine I only use customer_deleted_at. How can I set it to NULL?

Codeigniter query is "deleted_at IS NULL" when you call $model->findAll(), so you need to set that field = null but I don't know how to do it.

If I do $customer->customer_deleted_at = NULL; and then $model->save($customer) (or update($customer)) It doesn't save/update. What need to do?
Reply


Messages In This Thread
Model Update ignores null - by AngelRodriguez - 12-29-2021, 08:10 AM
RE: Model Update ignores null - by kenjis - 12-29-2021, 05:43 PM
RE: Model Update ignores null - by AngelRodriguez - 12-30-2021, 03:18 AM
RE: Model Update ignores null - by kenjis - 12-30-2021, 04:18 AM
RE: Model Update ignores null - by iRedds - 12-30-2021, 04:34 AM
RE: Model Update ignores null - by AngelRodriguez - 12-30-2021, 05:08 AM
RE: Model Update ignores null - by iRedds - 12-30-2021, 03:49 PM
RE: Model Update ignores null - by kenjis - 12-31-2021, 03:55 AM
RE: Model Update ignores null - by AngelRodriguez - 01-03-2022, 06:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB