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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
CHANGELOG.md
extensions/gii/CHANGELOG.md
+1
-0
Generator.php
extensions/gii/generators/model/Generator.php
+4
-0
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
--------------------------
-
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 #3693: Fixed broken Gii preview when a file is unchanged (cebe)
-
Enh #2018: Search model is not required anymore in CRUD generator (johonunu)
...
...
extensions/gii/generators/model/Generator.php
View file @
64618176
...
...
@@ -322,12 +322,16 @@ class Generator extends \yii\gii\Generator
// Add relation for the referenced table
$hasMany
=
false
;
if
(
count
(
$table
->
primaryKey
)
>
count
(
$fks
))
{
$hasMany
=
true
;
}
else
{
foreach
(
$fks
as
$key
)
{
if
(
!
in_array
(
$key
,
$table
->
primaryKey
,
true
))
{
$hasMany
=
true
;
break
;
}
}
}
$link
=
$this
->
generateRelationLink
(
$refs
);
$relationName
=
$this
->
generateRelationName
(
$relations
,
$refClassName
,
$refTable
,
$className
,
$hasMany
);
$relations
[
$refClassName
][
$relationName
]
=
[
...
...
framework/CHANGELOG.md
View file @
64618176
...
...
@@ -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 #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 #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)
...
...
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