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
23
32
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}
getQuotedName(AbstractPlatform $platform)
static namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)