This repository was archived by the owner on Nov 4, 2021. It is now read-only.
Commit fef3820
authored
Fix getKey check when ($model['id'] === 0)
I have inherited a project which has a row with an id of 0 which causes an exception to be thrown incorrectly.
Looking through $model->getKey() I noticed that it returns 'NULL' if a key doesn't exist but will return '(int) 0' if an 'id' key does exist with value of '(int) 0'.
'(int) 0' will evaluate as false even though it is in fact the correct value.1 parent 6214ac2 commit fef3820
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
0 commit comments