Harro Verton wrote on Tuesday 17th of January 2012:
You could use $model->is_new()...
Hmm so if I understand this right... if I load user with ID=5 from DB like $user = Model_User::find(5), then $user->is_new() would return true if user was loaded from DB or false, if user with id 5 does not exist?
No.
is_new() is true when an object doesn't have a primary key, i.e. is has never been saved before. That includes an "empty" model. If you find a record, is_new() returns false as the object has a primary key.
If you do a find and you get no results, there are no results.