MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
Column.php
Ir para a documentação deste ficheiro.
1
<?php
2
/*
3
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
*
15
* This software consists of voluntary contributions made by many individuals
16
* and is licensed under the LGPL. For more information, see
17
* <http://www.doctrine-project.org>.
18
*/
19
20
namespace
Doctrine\DBAL\Schema
;
21
22
use \Doctrine\DBAL\Types\Type;
23
use
Doctrine\DBAL\Schema\Visitor\Visitor
;
24
34
class
Column
extends
AbstractAsset
35
{
39
protected
$_type
;
40
44
protected
$_length
=
null
;
45
49
protected
$_precision
= 10;
50
54
protected
$_scale
= 0;
55
59
protected
$_unsigned
=
false
;
60
64
protected
$_fixed
=
false
;
65
69
protected
$_notnull
=
true
;
70
74
protected
$_default
=
null
;
75
79
protected
$_autoincrement
=
false
;
80
84
protected
$_platformOptions
= array();
85
89
protected
$_columnDefinition
=
null
;
90
105
public
function
__construct
($columnName,
Type
$type, array $options=array())
106
{
107
$this->
_setName
($columnName);
108
$this->
setType
($type);
109
$this->
setOptions
($options);
110
}
111
116
public
function
setOptions
(array $options)
117
{
118
foreach
($options AS $name => $value) {
119
$method =
"set"
.$name;
120
if
(method_exists($this, $method)) {
121
$this->$method($value);
122
}
123
}
124
return
$this;
125
}
126
131
public
function
setType
(
Type
$type)
132
{
133
$this->_type = $type;
134
return
$this;
135
}
136
141
public
function
setLength
($length)
142
{
143
if
($length !==
null
) {
144
$this->_length = (int)$length;
145
}
else
{
146
$this->_length =
null
;
147
}
148
return
$this;
149
}
150
155
public
function
setPrecision
($precision)
156
{
157
$this->_precision = (int)$precision;
158
return
$this;
159
}
160
165
public
function
setScale
($scale)
166
{
167
$this->_scale = $scale;
168
return
$this;
169
}
170
176
public
function
setUnsigned
($unsigned)
177
{
178
$this->_unsigned = (bool)$unsigned;
179
return
$this;
180
}
181
187
public
function
setFixed
($fixed)
188
{
189
$this->_fixed = (bool)$fixed;
190
return
$this;
191
}
192
197
public
function
setNotnull
($notnull)
198
{
199
$this->_notnull = (bool)$notnull;
200
return
$this;
201
}
202
208
public
function
setDefault
($default)
209
{
210
$this->_default = $default;
211
return
$this;
212
}
213
219
public
function
setPlatformOptions
(array $platformOptions)
220
{
221
$this->_platformOptions = $platformOptions;
222
return
$this;
223
}
224
231
public
function
setPlatformOption
($name, $value)
232
{
233
$this->_platformOptions[$name] = $value;
234
return
$this;
235
}
236
242
public
function
setColumnDefinition
($value)
243
{
244
$this->_columnDefinition = $value;
245
return
$this;
246
}
247
248
public
function
getType
()
249
{
250
return
$this->_type
;
251
}
252
253
public
function
getLength
()
254
{
255
return
$this->_length
;
256
}
257
258
public
function
getPrecision
()
259
{
260
return
$this->_precision
;
261
}
262
263
public
function
getScale
()
264
{
265
return
$this->_scale
;
266
}
267
268
public
function
getUnsigned
()
269
{
270
return
$this->_unsigned
;
271
}
272
273
public
function
getFixed
()
274
{
275
return
$this->_fixed
;
276
}
277
278
public
function
getNotnull
()
279
{
280
return
$this->_notnull
;
281
}
282
283
public
function
getDefault
()
284
{
285
return
$this->_default
;
286
}
287
288
public
function
getPlatformOptions
()
289
{
290
return
$this->_platformOptions
;
291
}
292
293
public
function
hasPlatformOption
($name)
294
{
295
return
isset($this->_platformOptions[$name]);
296
}
297
298
public
function
getPlatformOption
($name)
299
{
300
return
$this->_platformOptions[$name];
301
}
302
303
public
function
getColumnDefinition
()
304
{
305
return
$this->_columnDefinition
;
306
}
307
308
public
function
getAutoincrement
()
309
{
310
return
$this->_autoincrement
;
311
}
312
313
public
function
setAutoincrement
($flag)
314
{
315
$this->_autoincrement = $flag;
316
return
$this;
317
}
318
322
public
function
visit
(\Doctrine\DBAL\
Schema
\
Visitor
$visitor)
323
{
324
$visitor->accept($this);
325
}
326
330
public
function
toArray
()
331
{
332
return
array_merge(array(
333
'name'
=> $this->_name,
334
'type'
=> $this->_type,
335
'default'
=> $this->_default,
336
'notnull'
=> $this->_notnull,
337
'length'
=> $this->_length,
338
'precision'
=> $this->_precision,
339
'scale'
=> $this->_scale,
340
'fixed'
=> $this->_fixed,
341
'unsigned'
=> $this->_unsigned,
342
'autoincrement'
=> $this->_autoincrement,
343
'columnDefinition'
=> $this->_columnDefinition,
344
), $this->_platformOptions);
345
}
346
}
Doctrine\DBAL\Schema\AbstractAsset
Definição
AbstractAsset.php:39
Doctrine\DBAL\Schema\AbstractAsset\_setName
_setName($name)
Definição
AbstractAsset.php:52
Doctrine\DBAL\Schema\Column
Definição
Column.php:35
Doctrine\DBAL\Schema\Column\getPlatformOptions
getPlatformOptions()
Definição
Column.php:288
Doctrine\DBAL\Schema\Column\setDefault
setDefault($default)
Definição
Column.php:208
Doctrine\DBAL\Schema\Column\getPrecision
getPrecision()
Definição
Column.php:258
Doctrine\DBAL\Schema\Column\getFixed
getFixed()
Definição
Column.php:273
Doctrine\DBAL\Schema\Column\getNotnull
getNotnull()
Definição
Column.php:278
Doctrine\DBAL\Schema\Column\setAutoincrement
setAutoincrement($flag)
Definição
Column.php:313
Doctrine\DBAL\Schema\Column\getColumnDefinition
getColumnDefinition()
Definição
Column.php:303
Doctrine\DBAL\Schema\Column\__construct
__construct($columnName, Type $type, array $options=array())
Definição
Column.php:105
Doctrine\DBAL\Schema\Column\getScale
getScale()
Definição
Column.php:263
Doctrine\DBAL\Schema\Column\$_type
$_type
Definição
Column.php:39
Doctrine\DBAL\Schema\Column\setType
setType(Type $type)
Definição
Column.php:131
Doctrine\DBAL\Schema\Column\$_notnull
$_notnull
Definição
Column.php:69
Doctrine\DBAL\Schema\Column\setPlatformOptions
setPlatformOptions(array $platformOptions)
Definição
Column.php:219
Doctrine\DBAL\Schema\Column\setUnsigned
setUnsigned($unsigned)
Definição
Column.php:176
Doctrine\DBAL\Schema\Column\$_length
$_length
Definição
Column.php:44
Doctrine\DBAL\Schema\Column\toArray
toArray()
Definição
Column.php:330
Doctrine\DBAL\Schema\Column\setOptions
setOptions(array $options)
Definição
Column.php:116
Doctrine\DBAL\Schema\Column\$_autoincrement
$_autoincrement
Definição
Column.php:79
Doctrine\DBAL\Schema\Column\setNotnull
setNotnull($notnull)
Definição
Column.php:197
Doctrine\DBAL\Schema\Column\$_precision
$_precision
Definição
Column.php:49
Doctrine\DBAL\Schema\Column\getType
getType()
Definição
Column.php:248
Doctrine\DBAL\Schema\Column\visit
visit(\Doctrine\DBAL\Schema\Visitor $visitor)
Definição
Column.php:322
Doctrine\DBAL\Schema\Column\getUnsigned
getUnsigned()
Definição
Column.php:268
Doctrine\DBAL\Schema\Column\setFixed
setFixed($fixed)
Definição
Column.php:187
Doctrine\DBAL\Schema\Column\$_default
$_default
Definição
Column.php:74
Doctrine\DBAL\Schema\Column\$_unsigned
$_unsigned
Definição
Column.php:59
Doctrine\DBAL\Schema\Column\getLength
getLength()
Definição
Column.php:253
Doctrine\DBAL\Schema\Column\setLength
setLength($length)
Definição
Column.php:141
Doctrine\DBAL\Schema\Column\setPlatformOption
setPlatformOption($name, $value)
Definição
Column.php:231
Doctrine\DBAL\Schema\Column\$_scale
$_scale
Definição
Column.php:54
Doctrine\DBAL\Schema\Column\setScale
setScale($scale)
Definição
Column.php:165
Doctrine\DBAL\Schema\Column\$_platformOptions
$_platformOptions
Definição
Column.php:84
Doctrine\DBAL\Schema\Column\getDefault
getDefault()
Definição
Column.php:283
Doctrine\DBAL\Schema\Column\$_fixed
$_fixed
Definição
Column.php:64
Doctrine\DBAL\Schema\Column\hasPlatformOption
hasPlatformOption($name)
Definição
Column.php:293
Doctrine\DBAL\Schema\Column\getPlatformOption
getPlatformOption($name)
Definição
Column.php:298
Doctrine\DBAL\Schema\Column\getAutoincrement
getAutoincrement()
Definição
Column.php:308
Doctrine\DBAL\Schema\Column\setPrecision
setPrecision($precision)
Definição
Column.php:155
Doctrine\DBAL\Schema\Column\$_columnDefinition
$_columnDefinition
Definição
Column.php:89
Doctrine\DBAL\Schema\Column\setColumnDefinition
setColumnDefinition($value)
Definição
Column.php:242
Doctrine\DBAL\Schema\Schema
Definição
Schema.php:38
Doctrine\DBAL\Types\Type
Definição
Type.php:36
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
Column.php
Gerado por
1.10.0