Skip to content

Commit f67934d

Browse files
committed
改进视图模型的clone方法
1 parent 9923cc5 commit f67934d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/model/View.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(?Model $model = null)
4141
}
4242

4343
/**
44-
* 初始化实体数据属性(如果存在关联查询则会延迟执行).
44+
* 初始化实体数据属性.
4545
*
4646
* @return void
4747
*/
@@ -279,8 +279,7 @@ public function isEmpty(): bool
279279
public function clone()
280280
{
281281
$model = new static();
282-
$model->setModel($this->model());
283-
return $model;
282+
return $model->setModel($this->model());
284283
}
285284

286285
/**

0 commit comments

Comments
 (0)