MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
DropSchemaSqlCollector.php
Ir para a documentação deste ficheiro.
1
<?php
2
/*
3
* $Id$
4
*
5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
*
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the LGPL. For more information, see
19
* <http://www.doctrine-project.org>.
20
*/
21
22
namespace
Doctrine\DBAL\Schema\Visitor
;
23
24
use
Doctrine\DBAL\Platforms\AbstractPlatform
,
25
Doctrine\DBAL\Schema\Table
,
26
Doctrine\DBAL\Schema\Schema
,
27
Doctrine\DBAL\Schema\Column
,
28
Doctrine\DBAL\Schema\ForeignKeyConstraint
,
29
Doctrine\DBAL\Schema\Constraint
,
30
Doctrine\DBAL\Schema\Sequence
,
31
Doctrine\DBAL\Schema\Index
;
32
42
class
DropSchemaSqlCollector
implements
Visitor
43
{
47
private
$_constraints = array();
48
52
private
$_sequences = array();
53
57
private
$_tables = array();
58
63
private
$_platform =
null
;
64
68
public
function
__construct
(
AbstractPlatform
$platform)
69
{
70
$this->_platform = $platform;
71
}
72
76
public
function
acceptSchema
(
Schema
$schema)
77
{
78
79
}
80
84
public
function
acceptTable
(
Table
$table)
85
{
86
$this->_tables[] = $this->_platform->getDropTableSQL($table->
getQuotedName
($this->_platform));
87
}
88
92
public
function
acceptColumn
(
Table
$table,
Column
$column)
93
{
94
95
}
96
101
public
function
acceptForeignKey
(
Table
$localTable,
ForeignKeyConstraint
$fkConstraint)
102
{
103
if
(strlen($fkConstraint->
getName
()) == 0) {
104
throw
SchemaException::namedForeignKeyRequired
($localTable, $fkConstraint);
105
}
106
107
$this->_constraints[] = $this->_platform->getDropForeignKeySQL($fkConstraint->
getQuotedName
($this->_platform), $localTable->
getQuotedName
($this->_platform));
108
}
109
114
public
function
acceptIndex
(
Table
$table,
Index
$index)
115
{
116
117
}
118
122
public
function
acceptSequence
(
Sequence
$sequence)
123
{
124
$this->_sequences[] = $this->_platform->getDropSequenceSQL($sequence->
getQuotedName
($this->_platform));
125
}
126
130
public
function
clearQueries
()
131
{
132
$this->_constraints = $this->_sequences = $this->_tables = array();
133
}
134
138
public
function
getQueries
()
139
{
140
return
array_merge($this->_constraints, $this->_tables, $this->_sequences);
141
}
142
}
Doctrine\DBAL\Platforms\AbstractPlatform
Definição
AbstractPlatform.php:47
Doctrine\DBAL\Schema\AbstractAsset\getName
getName()
Definição
AbstractAsset.php:72
Doctrine\DBAL\Schema\AbstractAsset\getQuotedName
getQuotedName(AbstractPlatform $platform)
Definição
AbstractAsset.php:84
Doctrine\DBAL\Schema\Column
Definição
Column.php:35
Doctrine\DBAL\Schema\ForeignKeyConstraint
Definição
ForeignKeyConstraint.php:27
Doctrine\DBAL\Schema\Index
Definição
Index.php:25
Doctrine\DBAL\Schema\SchemaException\namedForeignKeyRequired
static namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
Definição
SchemaException.php:113
Doctrine\DBAL\Schema\Schema
Definição
Schema.php:38
Doctrine\DBAL\Schema\Sequence
Definição
Sequence.php:36
Doctrine\DBAL\Schema\Table
Definição
Table.php:38
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector
Definição
DropSchemaSqlCollector.php:43
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\clearQueries
clearQueries()
Definição
DropSchemaSqlCollector.php:130
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptSchema
acceptSchema(Schema $schema)
Definição
DropSchemaSqlCollector.php:76
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\__construct
__construct(AbstractPlatform $platform)
Definição
DropSchemaSqlCollector.php:68
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptIndex
acceptIndex(Table $table, Index $index)
Definição
DropSchemaSqlCollector.php:114
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptColumn
acceptColumn(Table $table, Column $column)
Definição
DropSchemaSqlCollector.php:92
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\getQueries
getQueries()
Definição
DropSchemaSqlCollector.php:138
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptTable
acceptTable(Table $table)
Definição
DropSchemaSqlCollector.php:84
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptSequence
acceptSequence(Sequence $sequence)
Definição
DropSchemaSqlCollector.php:122
Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector\acceptForeignKey
acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
Definição
DropSchemaSqlCollector.php:101
Doctrine\DBAL\Schema\Constraint
Definição
Constraint.php:34
Doctrine\DBAL\Schema\Visitor\Visitor
Definição
Visitor.php:43
Doctrine\DBAL\Schema\Visitor
Definição
CreateSchemaSqlCollector.php:22
classes
extensions
doctrine-dbal
Doctrine
DBAL
Schema
Visitor
DropSchemaSqlCollector.php
Gerado por
1.10.0