From b13c07d3c4c8e754451ad54381841b8d4cf742ab Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 19 Jun 2026 15:27:18 -0300 Subject: [PATCH] fix(model): Remove the NULL check in the attribute loop --- src/Libs/Model.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Libs/Model.php b/src/Libs/Model.php index 2cf4c88..e3f43a8 100644 --- a/src/Libs/Model.php +++ b/src/Libs/Model.php @@ -480,12 +480,8 @@ class Model $set = []; foreach ($atts as $key => $value) { - if ($value !== null) { - $set[] = "$key=:$key"; - static::$dbQueryVariables[':' . $key] = $value; - } else { - $set[] = "$key=NULL"; - } + $set[] = "$key=:$key"; + static::$dbQueryVariables[':' . $key] = $value; } $table = static::table(); @@ -511,11 +507,9 @@ class Model static::$dbQueryVariables = []; foreach ($atts as $key => $value) { - if (isset($value)) { - $into[] = "$key"; - $values[] = ":$key"; - static::$dbQueryVariables[":$key"] = $value; - } + $into[] = "$key"; + $values[] = ":$key"; + static::$dbQueryVariables[":$key"] = $value; } $table = static::table();