Skip to content

Commit

Permalink
fix sqlAssignColumns build method
Browse files Browse the repository at this point in the history
  • Loading branch information
Link1515 committed Mar 25, 2024
1 parent 8775c15 commit 6079749
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ORM/ORM.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function updateByIdForTable($tableName, $id, $data)

$query =
'UPDATE ' . $tableName .
' SET ' . self::sqlAssignColumns($columns) .
' SET ' . self::sqlAssignColumns($columns, true) .
' WHERE ' . self::sqlAssignSingleColumn('id');

$pdo = isset (static::$_pdo) ? static::$_pdo : DB::PDO();
Expand Down Expand Up @@ -189,9 +189,9 @@ protected static function sqlAssignSingleColumn($key)
protected static function sqlAssignColumns($columns, $filterId = false)
{
if ($filterId) {
$columns = array_filter($columns, function ($key) {
return $key !== 'id';
}, ARRAY_FILTER_USE_KEY);
$columns = array_filter($columns, function ($column) {
return $column !== 'id';
});
}

$sqlStr =
Expand Down

0 comments on commit 6079749

Please sign in to comment.