MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
CreateSchemaSqlCollector.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
33
class
CreateSchemaSqlCollector
implements
Visitor
34
{
38
private
$_createTableQueries = array();
39
43
private
$_createSequenceQueries = array();
44
48
private
$_createFkConstraintQueries = array();
49
54
private
$_platform =
null
;
55
59
public
function
__construct
(
AbstractPlatform
$platform)
60
{
61
$this->_platform = $platform;
62
}
63
67
public
function
acceptSchema
(
Schema
$schema)
68
{
69
70
}
71
77
public
function
acceptTable
(
Table
$table)
78
{
79
$this->_createTableQueries = array_merge($this->_createTableQueries,
80
$this->_platform->getCreateTableSQL($table)
81
);
82
}
83
84
public
function
acceptColumn
(
Table
$table,
Column
$column)
85
{
86
87
}
88
93
public
function
acceptForeignKey
(
Table
$localTable,
ForeignKeyConstraint
$fkConstraint)
94
{
95
// Append the foreign key constraints SQL
96
if
($this->_platform->supportsForeignKeyConstraints()) {
97
$this->_createFkConstraintQueries = array_merge($this->_createFkConstraintQueries,
98
(array) $this->_platform->getCreateForeignKeySQL(
99
$fkConstraint, $localTable->
getQuotedName
($this->_platform)
100
)
101
);
102
}
103
}
104
109
public
function
acceptIndex
(
Table
$table,
Index
$index)
110
{
111
112
}
113
117
public
function
acceptSequence
(
Sequence
$sequence)
118
{
119
$this->_createSequenceQueries = array_merge(
120
$this->_createSequenceQueries, (array)$this->_platform->getCreateSequenceSQL($sequence)
121
);
122
}
123
127
public
function
resetQueries
()
128
{
129
$this->_createTableQueries = array();
130
$this->_createSequenceQueries = array();
131
$this->_createFkConstraintQueries = array();
132
}
133
139
public
function
getQueries
()
140
{
141
return
array_merge(
142
$this->_createTableQueries,
143
$this->_createSequenceQueries,
144
$this->_createFkConstraintQueries
145
);
146
}
147
}
Doctrine\DBAL\Platforms\AbstractPlatform
Definição
AbstractPlatform.php:47
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\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\CreateSchemaSqlCollector
Definição
CreateSchemaSqlCollector.php:34
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptSchema
acceptSchema(Schema $schema)
Definição
CreateSchemaSqlCollector.php:67
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\__construct
__construct(AbstractPlatform $platform)
Definição
CreateSchemaSqlCollector.php:59
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptIndex
acceptIndex(Table $table, Index $index)
Definição
CreateSchemaSqlCollector.php:109
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptColumn
acceptColumn(Table $table, Column $column)
Definição
CreateSchemaSqlCollector.php:84
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\getQueries
getQueries()
Definição
CreateSchemaSqlCollector.php:139
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptTable
acceptTable(Table $table)
Definição
CreateSchemaSqlCollector.php:77
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptSequence
acceptSequence(Sequence $sequence)
Definição
CreateSchemaSqlCollector.php:117
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\acceptForeignKey
acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
Definição
CreateSchemaSqlCollector.php:93
Doctrine\DBAL\Schema\Visitor\CreateSchemaSqlCollector\resetQueries
resetQueries()
Definição
CreateSchemaSqlCollector.php:127
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
CreateSchemaSqlCollector.php
Gerado por
1.10.0