Skip to content

Commit

Permalink
修正关联数据赋值
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Jan 22, 2025
1 parent 2d97f06 commit 2845b0f
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 @@ -1296,7 +1296,7 @@ public function set(string $name, $value)
if (is_null($value) && is_subclass_of($type, Entity::class)) {
// 关联数据为空 设置一个空模型
$value = new $type();
} else {
} elseif (!($value instanceof Entity || $value instanceof Collection)) {
// 类型自动转换
$value = $this->readTransform($value, $type);
}
Expand Down

0 comments on commit 2845b0f

Please sign in to comment.