Commit 07391b6d by Carsten Brandt

fixed wrong relation class name in gii model generator

fixes #1146
parent b7990d3d
......@@ -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,
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment