From f473abe17faf54aa26c7bdffc7456e1862d3eec6 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 2 Dec 2013 21:00:58 -0500 Subject: [PATCH] Fixes #1405: fixed disambiguation of relation names generated by gii. --- extensions/gii/generators/model/Generator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/gii/generators/model/Generator.php b/extensions/gii/generators/model/Generator.php index cd2fcbf..591cb3b 100644 --- a/extensions/gii/generators/model/Generator.php +++ b/extensions/gii/generators/model/Generator.php @@ -397,10 +397,10 @@ class Generator extends \yii\gii\Generator } $name = $rawName = Inflector::id2camel($key, '_'); $i = 0; - while (isset($table->columns[$name])) { + while (isset($table->columns[lcfirst($name)])) { $name = $rawName . ($i++); } - while (isset($relations[$className][$name])) { + while (isset($relations[$className][lcfirst($name)])) { $name = $rawName . ($i++); }