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
9a018f44
Commit
9a018f44
authored
Oct 31, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DDC-1266' into 2.1.x
parents
cc09204a
71778daa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
18 deletions
+36
-18
DropSchemaSqlCollector.php
lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php
+35
-17
doctrine-common
lib/vendor/doctrine-common
+1
-1
No files found.
lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php
View file @
9a018f44
...
...
@@ -42,32 +42,35 @@ use Doctrine\DBAL\Platforms\AbstractPlatform,
class
DropSchemaSqlCollector
implements
Visitor
{
/**
* @var
array
* @var
\SplObjectStorage
*/
private
$
_constraints
=
array
()
;
private
$
constraints
;
/**
* @var
array
* @var
\SplObjectStorage
*/
private
$
_sequences
=
array
()
;
private
$
sequences
;
/**
* @var
array
* @var
\SplObjectStorage
*/
private
$
_tables
=
array
()
;
private
$
tables
;
/**
*
* @var \Doctrine\DBAL\Platforms\AbstractPlatform
*/
private
$
_platform
=
null
;
private
$
platform
;
/**
* @param AbstractPlatform $platform
*/
public
function
__construct
(
AbstractPlatform
$platform
)
{
$this
->
_platform
=
$platform
;
$this
->
platform
=
$platform
;
$this
->
constraints
=
new
\SplObjectStorage
();
$this
->
sequences
=
new
\SplObjectStorage
();
$this
->
tables
=
new
\SplObjectStorage
();
}
/**
...
...
@@ -75,7 +78,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
acceptSchema
(
Schema
$schema
)
{
}
/**
...
...
@@ -83,7 +86,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
acceptTable
(
Table
$table
)
{
$this
->
_tables
[]
=
$this
->
_platform
->
getDropTableSQL
(
$table
->
getQuotedName
(
$this
->
_platform
)
);
$this
->
tables
->
attach
(
$table
);
}
/**
...
...
@@ -91,7 +94,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
acceptColumn
(
Table
$table
,
Column
$column
)
{
}
/**
...
...
@@ -104,7 +107,8 @@ class DropSchemaSqlCollector implements Visitor
throw
SchemaException
::
namedForeignKeyRequired
(
$localTable
,
$fkConstraint
);
}
$this
->
_constraints
[]
=
$this
->
_platform
->
getDropForeignKeySQL
(
$fkConstraint
->
getQuotedName
(
$this
->
_platform
),
$localTable
->
getQuotedName
(
$this
->
_platform
));
$this
->
constraints
->
attach
(
$fkConstraint
);
$this
->
constraints
[
$fkConstraint
]
=
$localTable
;
}
/**
...
...
@@ -113,7 +117,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
acceptIndex
(
Table
$table
,
Index
$index
)
{
}
/**
...
...
@@ -121,7 +125,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
acceptSequence
(
Sequence
$sequence
)
{
$this
->
_sequences
[]
=
$this
->
_platform
->
getDropSequenceSQL
(
$sequence
->
getQuotedName
(
$this
->
_platform
)
);
$this
->
sequences
->
attach
(
$sequence
);
}
/**
...
...
@@ -129,7 +133,7 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
clearQueries
()
{
$this
->
_constraints
=
$this
->
_sequences
=
$this
->
_
tables
=
array
();
$this
->
constraints
=
$this
->
sequences
=
$this
->
tables
=
array
();
}
/**
...
...
@@ -137,6 +141,20 @@ class DropSchemaSqlCollector implements Visitor
*/
public
function
getQueries
()
{
return
array_merge
(
$this
->
_constraints
,
$this
->
_sequences
,
$this
->
_tables
);
$sql
=
array
();
foreach
(
$this
->
constraints
AS
$fkConstraint
)
{
$localTable
=
$this
->
constraints
[
$fkConstraint
];
$sql
[]
=
$this
->
platform
->
getDropForeignKeySQL
(
$fkConstraint
->
getQuotedName
(
$this
->
platform
),
$localTable
->
getQuotedName
(
$this
->
platform
));
}
foreach
(
$this
->
sequences
AS
$sequence
)
{
$sql
[]
=
$this
->
platform
->
getDropSequenceSQL
(
$sequence
->
getQuotedName
(
$this
->
platform
));
}
foreach
(
$this
->
tables
AS
$table
)
{
$sql
[]
=
$this
->
platform
->
getDropTableSQL
(
$table
->
getQuotedName
(
$this
->
platform
));
}
return
$sql
;
}
}
doctrine-common
@
40f1bf16
Subproject commit
b385ca770888248241bd3086a40d5b3bd082a706
Subproject commit
40f1bf16e84ddc5291a6a63aa00b9879c40e3500
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