You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Currently, find()->last() causes an Internal Error.
I discussed a bit of the subject wirth Admad who consider it as 'normal'.
I don't really agree with him.
'Internal error' means a critical situation.
But empty table is a 'normal' situation.
If there is no first record, there is no last record either.
If first() doesn't causes an Internal error, last() shouldn't cause it either.
I suggest that last() just returns null, as first() do, if we invoke it on empty table.
Hi,
Currently, find()->last() causes an Internal Error.
I discussed a bit of the subject wirth Admad who consider it as 'normal'.
I don't really agree with him.
'Internal error' means a critical situation.
But empty table is a 'normal' situation.
If there is no first record, there is no last record either.
If first() doesn't causes an Internal error, last() shouldn't cause it either.
I suggest that last() just returns null, as first() do, if we invoke it on empty table.
And if we look at this doc http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/collection_method.htm, calling FIRST or LAST on empty collection should just return null so, why to not do like that in Cake?
Regards
The text was updated successfully, but these errors were encountered: