Skip to content

Commit

Permalink
改进
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Dec 2, 2024
1 parent 30a05eb commit 0796f1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,7 @@ public function __get(string $name)
*/
public function __set(string $name, $value): void
{
$bind = $this->getBindAttr(self::$weakMap[$this]['bind_attr'], $name);
if ($value instanceof Entity && $bind) {
if ($value instanceof Entity && $bind = $this->getBindAttr(self::$weakMap[$this]['bind_attr'], $name)) {
// 关联属性绑定
$this->bindRelationAttr($value, $bind);
} else {
Expand Down

0 comments on commit 0796f1d

Please sign in to comment.