From 07391b6dc198d66c0ac917f2b2dedbee7748a6c4 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 6 Nov 2013 14:30:53 +0100 Subject: [PATCH] fixed wrong relation class name in gii model generator fixes #1146 --- extensions/gii/generators/model/Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/gii/generators/model/Generator.php b/extensions/gii/generators/model/Generator.php index 99f2d38..4f628d7 100644 --- a/extensions/gii/generators/model/Generator.php +++ b/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, ];