@@ -212,8 +212,8 @@ abstract class BaseModel
212212 protected bool $ updateOnlyChanged = true ;
213213
214214 /**
215- * Rules used to validate data
216- * in $this->insert (), $this->update(), $this->save () methods.
215+ * Rules used to validate data in insert(), update(), save(),
216+ * insertBatch (), and updateBatch () methods.
217217 *
218218 * The array must match the format of data passed to the `Validation`
219219 * library.
@@ -973,8 +973,7 @@ public function update($id = null, $row = null): bool
973973 throw new InvalidArgumentException ('update(): argument #1 ($id) should not be boolean. ' );
974974 }
975975
976- // if (is_numeric($id) || is_string($id)) {
977- if (! in_array ($ id , [null , 0 , '0 ' ], true ) && (is_numeric ($ id ) || is_string ($ id ))) {
976+ if (is_numeric ($ id ) || is_string ($ id )) {
978977 $ id = [$ id ];
979978 }
980979
@@ -1105,7 +1104,7 @@ public function delete($id = null, bool $purge = false)
11051104 throw new InvalidArgumentException ('delete(): argument #1 ($id) should not be boolean. ' );
11061105 }
11071106
1108- if (! in_array ( $ id , [ null , 0 , ' 0 ' ], true ) && ( is_numeric ($ id ) || is_string ($ id) )) {
1107+ if (is_numeric ($ id ) || is_string ($ id )) {
11091108 $ id = [$ id ];
11101109 }
11111110
0 commit comments