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
0e1aac7e
Commit
0e1aac7e
authored
Aug 14, 2015
by
Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored class CreateSchemaSqlCollector
parent
3a698bd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
33 deletions
+9
-33
CreateSchemaSqlCollector.php
...Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+9
-33
No files found.
lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
View file @
0e1aac7e
...
...
@@ -66,10 +66,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
public
function
acceptNamespace
(
$namespaceName
)
{
if
(
$this
->
platform
->
supportsSchemas
())
{
$this
->
createNamespaceQueries
=
array_merge
(
$this
->
createNamespaceQueries
,
(
array
)
$this
->
platform
->
getCreateSchemaSQL
(
$namespaceName
)
);
$this
->
createNamespaceQueries
[]
=
$this
->
platform
->
getCreateSchemaSQL
(
$namespaceName
);
}
}
...
...
@@ -87,12 +84,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
public
function
acceptForeignKey
(
Table
$localTable
,
ForeignKeyConstraint
$fkConstraint
)
{
if
(
$this
->
platform
->
supportsForeignKeyConstraints
())
{
$this
->
createFkConstraintQueries
=
array_merge
(
$this
->
createFkConstraintQueries
,
(
array
)
$this
->
platform
->
getCreateForeignKeySQL
(
$fkConstraint
,
$localTable
)
);
$this
->
createFkConstraintQueries
[]
=
$this
->
platform
->
getCreateForeignKeySQL
(
$fkConstraint
,
$localTable
);
}
}
...
...
@@ -101,10 +93,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
*/
public
function
acceptSequence
(
Sequence
$sequence
)
{
$this
->
createSequenceQueries
=
array_merge
(
$this
->
createSequenceQueries
,
(
array
)
$this
->
platform
->
getCreateSequenceSQL
(
$sequence
)
);
$this
->
createSequenceQueries
[]
=
$this
->
platform
->
getCreateSequenceSQL
(
$sequence
);
}
/**
...
...
@@ -125,24 +114,11 @@ class CreateSchemaSqlCollector extends AbstractVisitor
*/
public
function
getQueries
()
{
$sql
=
array
();
foreach
(
$this
->
createNamespaceQueries
as
$schemaSql
)
{
$sql
=
array_merge
(
$sql
,
(
array
)
$schemaSql
);
}
foreach
(
$this
->
createTableQueries
as
$schemaSql
)
{
$sql
=
array_merge
(
$sql
,
(
array
)
$schemaSql
);
}
foreach
(
$this
->
createSequenceQueries
as
$schemaSql
)
{
$sql
=
array_merge
(
$sql
,
(
array
)
$schemaSql
);
}
foreach
(
$this
->
createFkConstraintQueries
as
$schemaSql
)
{
$sql
=
array_merge
(
$sql
,
(
array
)
$schemaSql
);
}
return
$sql
;
return
array_merge
(
$this
->
createNamespaceQueries
,
$this
->
createTableQueries
,
$this
->
createSequenceQueries
,
$this
->
createFkConstraintQueries
);
}
}
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