File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,25 +40,25 @@ public function __construct(?Model $model = null, bool $with = false)
40
40
41
41
// 初始化模型
42
42
if (!$ this ->isEmpty ()) {
43
- $ this ->initData ($ with );
43
+ $ this ->initData (! $ with );
44
44
}
45
45
}
46
46
47
47
/**
48
48
* 初始化实体数据属性(如果存在关联查询则会延迟执行).
49
49
*
50
- * @param bool $with 是否处理关联数据
50
+ * @param bool $relation 是否处理关联数据
51
51
* @return void
52
52
*/
53
- public function initData (bool $ with = true )
53
+ public function initData (bool $ relation = true )
54
54
{
55
55
// 获取实体属性
56
56
$ properties = $ this ->getEntityProperties ();
57
57
$ data = $ this ->model ()->getData ();
58
58
foreach ($ properties as $ key => $ field ) {
59
- if (!$ with ) {
59
+ if (!$ relation ) {
60
60
// 确保存在基础模型数据
61
- if (isset ($ data [$ field ])) {
61
+ if (isset ($ data [$ field ])) {
62
62
$ this ->$ field = $ data [$ field ];
63
63
}
64
64
continue ;
You can’t perform that action at this time.
0 commit comments