Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
8faf31e3
Commit
8faf31e3
authored
Jun 20, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
b8c2005b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
Export.php
lib/Doctrine/Export.php
+3
-5
Mysql.php
lib/Doctrine/Export/Mysql.php
+1
-4
Table.php
lib/Doctrine/Table.php
+2
-4
No files found.
lib/Doctrine/Export.php
View file @
8faf31e3
...
...
@@ -223,10 +223,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
foreach
((
array
)
$options
[
'foreignKeys'
]
as
$k
=>
$definition
)
{
if
(
is_array
(
$definition
))
{
if
(
!
isset
(
$definition
[
'table'
]))
{
$definition
[
'table'
]
=
$name
;
}
$sql
[]
=
$this
->
createForeignKeySql
(
$definition
[
'table'
],
$definition
);
$sql
[]
=
$this
->
createForeignKeySql
(
$name
,
$definition
);
}
}
}
...
...
@@ -868,6 +865,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
if
(
!
is_array
(
$definition
[
'foreign'
]))
{
$definition
[
'foreign'
]
=
array
(
$definition
[
'foreign'
]);
}
$sql
.=
implode
(
', '
,
array_map
(
array
(
$this
->
conn
,
'quoteIdentifier'
),
$definition
[
'local'
]))
.
') REFERENCES '
.
$definition
[
'foreignTable'
]
.
'('
...
...
@@ -1007,7 +1005,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
else
{
$sql
[]
=
$query
;
}
if
(
isset
(
$data
[
'options'
][
'foreignKeys'
])
&&
is_array
(
$data
[
'options'
][
'foreignKeys'
]))
{
$fks
[
$table
->
getTableName
()]
=
$data
[
'options'
][
'foreignKeys'
];
}
...
...
lib/Doctrine/Export/Mysql.php
View file @
8faf31e3
...
...
@@ -166,10 +166,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
foreach
((
array
)
$options
[
'foreignKeys'
]
as
$k
=>
$definition
)
{
if
(
is_array
(
$definition
))
{
if
(
!
isset
(
$definition
[
'table'
]))
{
$definition
[
'table'
]
=
$name
;
}
$sql
[]
=
$this
->
createForeignKeySql
(
$definition
[
'table'
],
$definition
);
$sql
[]
=
$this
->
createForeignKeySql
(
$name
,
$definition
);
}
}
}
...
...
lib/Doctrine/Table.php
View file @
8faf31e3
...
...
@@ -382,9 +382,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$relation
->
hasConstraint
())
{
$def
=
array
(
'local'
=>
$relation
->
getLocal
(),
'table'
=>
$relation
->
getTable
()
->
getTableName
(),
'foreign'
=>
$this
->
getIdentifier
(),
'foreignTable'
=>
$
this
->
getTableName
());
'foreignTable'
=>
$
relation
->
getTable
()
->
getTableName
());
if
((
$key
=
array_search
(
$def
,
$options
[
'foreignKeys'
]))
===
false
)
{
$options
[
'foreignKeys'
][]
=
$def
;
...
...
@@ -402,9 +401,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$relation
->
getForeign
()
!==
$relation
->
getTable
()
->
getIdentifier
())
{
$def
=
array
(
'local'
=>
$relation
->
getLocal
(),
'table'
=>
$relation
->
getTable
()
->
getTableName
(),
'foreign'
=>
$this
->
getIdentifier
(),
'foreignTable'
=>
$
this
->
getTableName
());
'foreignTable'
=>
$
relation
->
getTable
()
->
getTableName
());
if
((
$key
=
array_search
(
$def
,
$options
[
'foreignKeys'
]))
===
false
)
{
$options
[
'foreignKeys'
][]
=
$def
;
...
...
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