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
406c57b5
Commit
406c57b5
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- cosmetic fixes
parent
64e1f6e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
Export.php
lib/Doctrine/Export.php
+24
-24
No files found.
lib/Doctrine/Export.php
View file @
406c57b5
...
...
@@ -44,7 +44,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
'date'
=>
'1970-01-01'
,
'clob'
=>
''
,
'blob'
=>
''
,
'string'
=>
''
'string'
=>
''
,
);
/**
...
...
@@ -117,7 +117,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
public
function
dropIndexSql
(
$table
,
$name
)
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getIndexName
(
$name
));
return
'DROP INDEX '
.
$name
;
}
...
...
@@ -133,7 +133,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
{
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
);
return
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$table
.
' DROP CONSTRAINT '
.
$name
);
}
...
...
@@ -358,7 +358,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
public
function
createConstraint
(
$table
,
$name
,
$definition
)
{
$sql
=
$this
->
createConstraintSql
(
$table
,
$name
,
$definition
);
return
$this
->
conn
->
exec
(
$sql
);
}
...
...
@@ -474,7 +474,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
$query
.=
' ('
.
implode
(
', '
,
$fields
)
.
')'
;
return
$query
;
}
}
/**
* createForeignKeySql
*
...
...
@@ -501,7 +501,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
public
function
createForeignKey
(
$table
,
array
$definition
)
{
$sql
=
$this
->
createForeignKeySql
(
$table
,
$definition
);
return
$this
->
conn
->
execute
(
$sql
);
}
...
...
@@ -597,7 +597,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
public
function
alterTable
(
$name
,
array
$changes
,
$check
=
false
)
{
$sql
=
$this
->
alterTableSql
(
$name
,
$changes
,
$check
);
if
(
is_string
(
$sql
)
&&
$sql
)
{
$this
->
conn
->
execute
(
$sql
);
}
...
...
@@ -1045,7 +1045,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
else
{
$models
=
Doctrine
::
getLoadedModels
();
}
$this
->
exportClasses
(
$models
);
}
...
...
@@ -1065,13 +1065,13 @@ class Doctrine_Export extends Doctrine_Connection_Module
$record
=
new
$class
();
$connection
=
$record
->
getTable
()
->
getConnection
();
$connectionName
=
Doctrine_Manager
::
getInstance
()
->
getConnectionName
(
$connection
);
if
(
!
isset
(
$connections
[
$connectionName
]))
{
$connections
[
$connectionName
]
=
array
();
$connections
[
$connectionName
][
'creates'
]
=
array
();
$connections
[
$connectionName
][
'alters'
]
=
array
();
}
$sql
=
$this
->
exportClassesSql
(
array
(
$class
));
// Build array of all the creates
// We need these to happen first
...
...
@@ -1082,7 +1082,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
unset
(
$sql
[
$key
]);
}
}
$connections
[
$connectionName
][
'alters'
]
=
array_merge
(
$connections
[
$connectionName
][
'alters'
],
$sql
);
}
...
...
@@ -1094,9 +1094,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
foreach
(
$build
as
$connectionName
=>
$sql
)
{
$connection
=
Doctrine_Manager
::
getInstance
()
->
getConnection
(
$connectionName
);
$connection
->
beginTransaction
();
foreach
(
$sql
as
$query
)
{
try
{
$connection
->
exec
(
$query
);
...
...
@@ -1108,7 +1108,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
}
}
$connection
->
commit
();
}
}
...
...
@@ -1125,9 +1125,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
public
function
exportClassesSql
(
array
$classes
)
{
$models
=
Doctrine
::
filterInvalidModels
(
$classes
);
$sql
=
array
();
foreach
(
$models
as
$name
)
{
$record
=
new
$name
();
$table
=
$record
->
getTable
();
...
...
@@ -1138,7 +1138,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
$data
=
$table
->
getConnection
()
->
getTable
(
$parent
)
->
getExportableFormat
();
$query
=
$this
->
conn
->
export
->
createTableSql
(
$data
[
'tableName'
],
$data
[
'columns'
],
$data
[
'options'
]);
$sql
=
array_merge
(
$sql
,
(
array
)
$query
);
}
...
...
@@ -1151,14 +1151,14 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
else
{
$sql
[]
=
$query
;
}
if
(
$table
->
getAttribute
(
Doctrine
::
ATTR_EXPORT
)
&
Doctrine
::
EXPORT_PLUGINS
)
{
$sql
=
array_merge
(
$sql
,
$this
->
exportGeneratorsSql
(
$table
));
}
}
$sql
=
array_unique
(
$sql
);
rsort
(
$sql
);
return
$sql
;
...
...
@@ -1176,13 +1176,13 @@ class Doctrine_Export extends Doctrine_Connection_Module
foreach
(
$table
->
getGenerators
()
as
$name
=>
$generator
)
{
if
(
$generator
===
null
)
{
continue
;
continue
;
}
$generators
[]
=
$generator
;
$generatorTable
=
$generator
->
getTable
();
if
(
$generatorTable
instanceof
Doctrine_Table
)
{
$generators
=
array_merge
(
$generators
,
$this
->
getAllGenerators
(
$generatorTable
));
}
...
...
@@ -1203,7 +1203,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
$sql
=
array
();
foreach
(
$this
->
getAllGenerators
(
$table
)
as
$name
=>
$generator
)
{
$table
=
$generator
->
getTable
();
// Make sure plugin has a valid table
if
(
$table
instanceof
Doctrine_Table
)
{
$data
=
$table
->
getExportableFormat
();
...
...
@@ -1237,7 +1237,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
}
else
{
$models
=
Doctrine
::
getLoadedModels
();
}
return
$this
->
exportClassesSql
(
$models
);
}
...
...
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