Browse Source

fixed wrong relation class name in gii model generator

fixes #1146
tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
07391b6dc1
  1. 2
      extensions/gii/generators/model/Generator.php

2
extensions/gii/generators/model/Generator.php

@ -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,
];

Loading…
Cancel
Save