fix(model): Remove the NULL check in the attribute loop
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user