Welcome Guest, Not a member yet? Register   Sign In
Why does $userModel->find(null) return all rows like $userModel->findAll()
#3

(03-20-2021, 06:16 AM)kenjis Wrote: find(null) means no where clause.
So you get all records.

yes, this I understand, it's according the documentation.

But what's the idea behind this? Why does it return all records when I say find(null)?
this is semantically nonsense... search for nothing should return nothing and not all. This would be more logical for my understanding..

furthermore find([]) gives a runtime error (empty where clause)...

to chain model functions it would give IMHO shorter an more simple code if I not need to check first the array containing id(s) to use find()
Reply


Messages In This Thread
RE: Why does $userModel->find(null) return all rows like $userModel->findAll() - by sba - 03-20-2021, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB