File tree 3 files changed +4
-6
lines changed
3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class AttributeResolver
38
38
public array $ relations = [];
39
39
40
40
/**
41
- * @var AttributeRelation[]| array
41
+ * @var array keys contains class names and value contains array of belongs to relations
42
42
*/
43
43
public array $ belongsToRelations = [];
44
44
Original file line number Diff line number Diff line change @@ -113,10 +113,8 @@ public function prepareModels(): array
113
113
// handle belongs to relation
114
114
foreach ($ resolvers as $ aResolver ) {
115
115
foreach ($ aResolver ->belongsToRelations as $ name => $ relations ) {
116
- foreach ($ relations as $ relation ) {
117
- /** @var AttributeRelation $relation */
118
- $ models [$ name ]->belongsToRelations [] = $ relation ;
119
- }
116
+ /** @var AttributeRelation[] $relations */
117
+ $ models [$ name ]->belongsToRelations = [...$ models [$ name ]->belongsToRelations , ...$ relations ];
120
118
}
121
119
}
122
120
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class DbModel extends BaseObject
86
86
public bool $ descriptionIsComment = false ;
87
87
88
88
/**
89
- * @var array| AttributeRelation[] belongs to relations
89
+ * @var AttributeRelation[] belongs to relations
90
90
*/
91
91
public array $ belongsToRelations = [];
92
92
You can’t perform that action at this time.
0 commit comments