Skip to content

Commit

Permalink
优化save方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Feb 13, 2025
1 parent 0c951d1 commit 1a770d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ public function save(array | object $data = [], $where = []): bool


foreach ($data as $name => &$val) {
if ($val instanceof Entity || is_subclass_of($this->getFields($name), Entity::class)) {
if ($val instanceof Entity) {
$relations[$name] = $val;
unset($data[$name]);
} elseif ($val instanceof Collection || !in_array($name, $allow)) {
Expand Down

0 comments on commit 1a770d3

Please sign in to comment.