Skip to content

Commit 97fa391

Browse files
committed
Table::updateFromTable only updates provided fields
1 parent 2085f71 commit 97fa391

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PHPFUI/ORM/Table.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,7 @@ public function updateFromTable(array $request) : bool
10101010
{
10111011
$data = [];
10121012

1013+
$record = new static::$className($existingKey);
10131014
foreach ($fields as $field => $typeInfo)
10141015
{
10151016
if (isset($request[$field]))
@@ -1024,7 +1025,7 @@ public function updateFromTable(array $request) : bool
10241025
}
10251026
}
10261027
}
1027-
$this->instance->setEmpty()->setFrom($data)->insertOrUpdate();
1028+
$record->setFrom($data)->insertOrUpdate();
10281029
}
10291030
}
10301031

0 commit comments

Comments
 (0)