File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class AttributeResolver
3838 public array $ relations = [];
3939
4040 /**
41- * @var AttributeRelation[]| array
41+ * @var array keys contains class names and value contains array of belongs to relations
4242 */
4343 public array $ belongsToRelations = [];
4444
Original file line number Diff line number Diff line change @@ -113,10 +113,8 @@ public function prepareModels(): array
113113 // handle belongs to relation
114114 foreach ($ resolvers as $ aResolver ) {
115115 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 ];
120118 }
121119 }
122120
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class DbModel extends BaseObject
8686 public bool $ descriptionIsComment = false ;
8787
8888 /**
89- * @var array| AttributeRelation[] belongs to relations
89+ * @var AttributeRelation[] belongs to relations
9090 */
9191 public array $ belongsToRelations = [];
9292
You can’t perform that action at this time.
0 commit comments