mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 02:13:17 +08:00
Fixes #1146: Gii generates wrong relation.
This commit is contained in:
@ -293,7 +293,7 @@ class Generator extends \yii\gii\Generator
|
||||
$link = $this->generateRelationLink($refs);
|
||||
$relationName = $this->generateRelationName($relations, $refClassName, $refTable, $className, $hasMany);
|
||||
$relations[$refClassName][$relationName] = [
|
||||
"return \$this->" . ($hasMany ? 'hasMany' : 'hasOne') . "($refClassName::className(), $link);",
|
||||
"return \$this->" . ($hasMany ? 'hasMany' : 'hasOne') . "($className::className(), $link);",
|
||||
$className,
|
||||
$hasMany,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user