@@ -100,7 +100,23 @@ public function resolve(): DbModel
100100 $ this ->resolveProperty ($ property , $ isRequired , $ nullableValue );
101101 }
102102 }
103- return $ this ->createDbModel ();
103+
104+ return Yii::createObject (DbModel::class, [
105+ [
106+ 'pkName ' => $ this ->schema ->getPkName (),
107+ 'name ' => $ this ->schemaName ,
108+ 'tableName ' => $ this ->tableName ,
109+ 'description ' => $ this ->schema ->getDescription (),
110+ 'attributes ' => $ this ->attributes ,
111+ 'relations ' => $ this ->relations ,
112+ 'nonDbRelations ' => $ this ->nonDbRelations ,
113+ 'many2many ' => $ this ->many2many ,
114+ 'indexes ' => $ this ->prepareIndexes ($ this ->schema ->getIndexes ()),
115+ //For valid primary keys for junction tables
116+ 'junctionCols ' => $ this ->isJunctionSchema ? $ this ->junctions ->junctionCols ($ this ->schemaName ) : [],
117+ 'isNotDb ' => $ this ->schema ->isNonDb (),
118+ ],
119+ ]);
104120 }
105121
106122 /**
@@ -472,29 +488,8 @@ protected function resolvePropertyRef(PropertySchema $property, Attribute $attri
472488 }
473489
474490 /**
475- * @throws InvalidDefinitionException
476491 * @throws InvalidConfigException
477492 */
478- public function createDbModel (): DbModel
479- {
480- return Yii::createObject (DbModel::class, [
481- [
482- 'pkName ' => $ this ->schema ->getPkName (),
483- 'name ' => $ this ->schemaName ,
484- 'tableName ' => $ this ->tableName ,
485- 'description ' => $ this ->schema ->getDescription (),
486- 'attributes ' => $ this ->attributes ,
487- 'relations ' => $ this ->relations ,
488- 'nonDbRelations ' => $ this ->nonDbRelations ,
489- 'many2many ' => $ this ->many2many ,
490- 'indexes ' => $ this ->prepareIndexes ($ this ->schema ->getIndexes ()),
491- //For valid primary keys for junction tables
492- 'junctionCols ' => $ this ->isJunctionSchema ? $ this ->junctions ->junctionCols ($ this ->schemaName ) : [],
493- 'isNotDb ' => $ this ->schema ->isNonDb (),
494- ],
495- ]);
496- }
497-
498493 public function addInverseRelation (
499494 string $ relatedClassName ,
500495 Attribute $ attribute ,
0 commit comments