fix(model): Remove the NULL check in the attribute loop
This commit is contained in:
@@ -480,12 +480,8 @@ class Model
|
|||||||
|
|
||||||
$set = [];
|
$set = [];
|
||||||
foreach ($atts as $key => $value) {
|
foreach ($atts as $key => $value) {
|
||||||
if ($value !== null) {
|
$set[] = "$key=:$key";
|
||||||
$set[] = "$key=:$key";
|
static::$dbQueryVariables[':' . $key] = $value;
|
||||||
static::$dbQueryVariables[':' . $key] = $value;
|
|
||||||
} else {
|
|
||||||
$set[] = "$key=NULL";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = static::table();
|
$table = static::table();
|
||||||
@@ -511,11 +507,9 @@ class Model
|
|||||||
static::$dbQueryVariables = [];
|
static::$dbQueryVariables = [];
|
||||||
|
|
||||||
foreach ($atts as $key => $value) {
|
foreach ($atts as $key => $value) {
|
||||||
if (isset($value)) {
|
$into[] = "$key";
|
||||||
$into[] = "$key";
|
$values[] = ":$key";
|
||||||
$values[] = ":$key";
|
static::$dbQueryVariables[":$key"] = $value;
|
||||||
static::$dbQueryVariables[":$key"] = $value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = static::table();
|
$table = static::table();
|
||||||
|
|||||||
Reference in New Issue
Block a user