MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
ForeignKeyConstraint.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
;
23
24
use
Doctrine\DBAL\Schema\Visitor\Visitor
;
25
26
class
ForeignKeyConstraint
extends
AbstractAsset
implements
Constraint
27
{
31
protected
$_localTable
;
32
36
protected
$_localColumnNames
;
37
41
protected
$_foreignTableName
;
42
46
protected
$_foreignColumnNames
;
47
51
protected
$_cascade
=
''
;
52
56
protected
$_options
;
57
66
public
function
__construct
(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name=
null
, array $options=array())
67
{
68
$this->
_setName
($name);
69
$this->_localColumnNames = $localColumnNames;
70
$this->_foreignTableName = $foreignTableName;
71
$this->_foreignColumnNames = $foreignColumnNames;
72
$this->_options = $options;
73
}
74
78
public
function
getLocalTableName
()
79
{
80
return
$this->_localTable->getName();
81
}
82
86
public
function
setLocalTable
(
Table
$table)
87
{
88
$this->_localTable = $table;
89
}
90
94
public
function
getLocalColumns
()
95
{
96
return
$this->_localColumnNames
;
97
}
98
99
public
function
getColumns
()
100
{
101
return
$this->_localColumnNames
;
102
}
103
107
public
function
getForeignTableName
()
108
{
109
return
$this->_foreignTableName
;
110
}
111
115
public
function
getForeignColumns
()
116
{
117
return
$this->_foreignColumnNames
;
118
}
119
120
public
function
hasOption
($name)
121
{
122
return
isset($this->_options[$name]);
123
}
124
125
public
function
getOption
($name)
126
{
127
return
$this->_options[$name];
128
}
129
135
public
function
onUpdate
()
136
{
137
return
$this->_onEvent(
'onUpdate'
);
138
}
139
145
public
function
onDelete
()
146
{
147
return
$this->_onEvent(
'onDelete'
);
148
}
149
154
private
function
_onEvent($event)
155
{
156
if
(isset($this->_options[$event])) {
157
$onEvent = strtoupper($this->_options[$event]);
158
if
(!in_array($onEvent, array(
'NO ACTION'
,
'RESTRICT'
))) {
159
return
$onEvent;
160
}
161
}
162
return
false
;
163
}
164
}
Doctrine\DBAL\Schema\AbstractAsset
Definição
AbstractAsset.php:39
Doctrine\DBAL\Schema\AbstractAsset\_setName
_setName($name)
Definição
AbstractAsset.php:52
Doctrine\DBAL\Schema\ForeignKeyConstraint
Definição
ForeignKeyConstraint.php:27
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_options
$_options
Definição
ForeignKeyConstraint.php:56
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_cascade
$_cascade
Definição
ForeignKeyConstraint.php:51
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_localColumnNames
$_localColumnNames
Definição
ForeignKeyConstraint.php:36
Doctrine\DBAL\Schema\ForeignKeyConstraint\onUpdate
onUpdate()
Definição
ForeignKeyConstraint.php:135
Doctrine\DBAL\Schema\ForeignKeyConstraint\setLocalTable
setLocalTable(Table $table)
Definição
ForeignKeyConstraint.php:86
Doctrine\DBAL\Schema\ForeignKeyConstraint\onDelete
onDelete()
Definição
ForeignKeyConstraint.php:145
Doctrine\DBAL\Schema\ForeignKeyConstraint\getColumns
getColumns()
Definição
ForeignKeyConstraint.php:99
Doctrine\DBAL\Schema\ForeignKeyConstraint\getLocalTableName
getLocalTableName()
Definição
ForeignKeyConstraint.php:78
Doctrine\DBAL\Schema\ForeignKeyConstraint\__construct
__construct(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name=null, array $options=array())
Definição
ForeignKeyConstraint.php:66
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_foreignColumnNames
$_foreignColumnNames
Definição
ForeignKeyConstraint.php:46
Doctrine\DBAL\Schema\ForeignKeyConstraint\getForeignTableName
getForeignTableName()
Definição
ForeignKeyConstraint.php:107
Doctrine\DBAL\Schema\ForeignKeyConstraint\getOption
getOption($name)
Definição
ForeignKeyConstraint.php:125
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_localTable
$_localTable
Definição
ForeignKeyConstraint.php:31
Doctrine\DBAL\Schema\ForeignKeyConstraint\getForeignColumns
getForeignColumns()
Definição
ForeignKeyConstraint.php:115
Doctrine\DBAL\Schema\ForeignKeyConstraint\hasOption
hasOption($name)
Definição
ForeignKeyConstraint.php:120
Doctrine\DBAL\Schema\ForeignKeyConstraint\getLocalColumns
getLocalColumns()
Definição
ForeignKeyConstraint.php:94
Doctrine\DBAL\Schema\ForeignKeyConstraint\$_foreignTableName
$_foreignTableName
Definição
ForeignKeyConstraint.php:41
Doctrine\DBAL\Schema\Table
Definição
Table.php:38
Doctrine\DBAL\Schema\Constraint
Definição
Constraint.php:34
Doctrine\DBAL\Schema\Visitor\Visitor
Definição
Visitor.php:43
Doctrine\DBAL\Schema
Definição
AbstractAsset.php:22
classes
extensions
doctrine-dbal
Doctrine
DBAL
Schema
ForeignKeyConstraint.php
Gerado por
1.10.0