Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
64618176
Commit
64618176
authored
Jun 10, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2314: Gii model generator does not generate correct relation type in some special case
parent
0d92cb4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
CHANGELOG.md
extensions/gii/CHANGELOG.md
+1
-0
Generator.php
extensions/gii/generators/model/Generator.php
+8
-4
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
No files found.
extensions/gii/CHANGELOG.md
View file @
64618176
...
@@ -5,6 +5,7 @@ Yii Framework 2 gii extension Change Log
...
@@ -5,6 +5,7 @@ Yii Framework 2 gii extension Change Log
--------------------------
--------------------------
-
Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
-
Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
-
Bug #2314: Gii model generator does not generate correct relation type in some special case (qiangxue)
-
Bug #3265: Fixed incorrect controller class name validation (suralc)
-
Bug #3265: Fixed incorrect controller class name validation (suralc)
-
Bug #3693: Fixed broken Gii preview when a file is unchanged (cebe)
-
Bug #3693: Fixed broken Gii preview when a file is unchanged (cebe)
-
Enh #2018: Search model is not required anymore in CRUD generator (johonunu)
-
Enh #2018: Search model is not required anymore in CRUD generator (johonunu)
...
...
extensions/gii/generators/model/Generator.php
View file @
64618176
...
@@ -322,10 +322,14 @@ class Generator extends \yii\gii\Generator
...
@@ -322,10 +322,14 @@ class Generator extends \yii\gii\Generator
// Add relation for the referenced table
// Add relation for the referenced table
$hasMany
=
false
;
$hasMany
=
false
;
foreach
(
$fks
as
$key
)
{
if
(
count
(
$table
->
primaryKey
)
>
count
(
$fks
))
{
if
(
!
in_array
(
$key
,
$table
->
primaryKey
,
true
))
{
$hasMany
=
true
;
$hasMany
=
true
;
}
else
{
break
;
foreach
(
$fks
as
$key
)
{
if
(
!
in_array
(
$key
,
$table
->
primaryKey
,
true
))
{
$hasMany
=
true
;
break
;
}
}
}
}
}
$link
=
$this
->
generateRelationLink
(
$refs
);
$link
=
$this
->
generateRelationLink
(
$refs
);
...
...
framework/CHANGELOG.md
View file @
64618176
...
@@ -5,6 +5,7 @@ Yii Framework 2 Change Log
...
@@ -5,6 +5,7 @@ Yii Framework 2 Change Log
--------------------------
--------------------------
-
Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
-
Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
-
Bug #2314: Gii model generator does not generate correct relation type in some special case (qiangxue)
-
Bug #2563: Theming is not working if the path map of the theme contains ".." or "." in the paths (qiangxue)
-
Bug #2563: Theming is not working if the path map of the theme contains ".." or "." in the paths (qiangxue)
-
Bug #2801: Fixed the issue that GridView gets footer content before data cells content (ElisDN)
-
Bug #2801: Fixed the issue that GridView gets footer content before data cells content (ElisDN)
-
Bug #2853: ActiveRecord did not handle resource-typed columns well (chris68, qiangxue)
-
Bug #2853: ActiveRecord did not handle resource-typed columns well (chris68, qiangxue)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment