16
16
class Table
17
17
{
18
18
/**
19
- * Types of columns
19
+ * Column type boolean
20
+ * @api
20
21
*/
21
22
const TYPE_BOOLEAN = 'boolean ' ;
22
23
24
+ /**
25
+ * Column type smallint
26
+ * @api
27
+ */
23
28
const TYPE_SMALLINT = 'smallint ' ;
24
29
30
+ /**
31
+ * Column type integer
32
+ * @api
33
+ */
25
34
const TYPE_INTEGER = 'integer ' ;
26
35
36
+ /**
37
+ * Column type bigint
38
+ * @api
39
+ */
27
40
const TYPE_BIGINT = 'bigint ' ;
28
41
42
+ /**
43
+ * Column type float
44
+ * @api
45
+ */
29
46
const TYPE_FLOAT = 'float ' ;
30
47
48
+ /**
49
+ * Column type numeric
50
+ * @api
51
+ */
31
52
const TYPE_NUMERIC = 'numeric ' ;
32
53
54
+ /**
55
+ * Column type decimal
56
+ * @api
57
+ */
33
58
const TYPE_DECIMAL = 'decimal ' ;
34
59
60
+ /**
61
+ * Column type date
62
+ * @api
63
+ */
35
64
const TYPE_DATE = 'date ' ;
36
65
66
+ /**
67
+ * Column type timestamp
68
+ * @api
69
+ */
37
70
const TYPE_TIMESTAMP = 'timestamp ' ;
38
71
39
- // Capable to support date-time from 1970 + auto-triggers in some RDBMS
72
+ /**
73
+ * Column type datetime, capable to support date-time from 1970 + auto-triggers in some RDBMS
74
+ * @api
75
+ */
40
76
const TYPE_DATETIME = 'datetime ' ;
41
77
42
- // Capable to support long date-time before 1970
78
+ /**
79
+ * Column type text, capable to support long date-time before 1970
80
+ * @api
81
+ */
43
82
const TYPE_TEXT = 'text ' ;
44
83
84
+ /**
85
+ * Column type blob
86
+ * @api
87
+ */
45
88
const TYPE_BLOB = 'blob ' ;
46
89
47
- // Used for back compatibility, when query param can't use statement options
90
+ /**
91
+ * Column type varbinary, used for back compatibility, when query param can't use statement options
92
+ * @api
93
+ */
48
94
const TYPE_VARBINARY = 'varbinary ' ;
49
95
50
- // A real blob, stored as binary inside DB
51
-
52
96
/**
53
- * Default and maximal TEXT and BLOB columns sizes we can support for different DB systems.
97
+ * Default TEXT columns sizes
98
+ * @api
54
99
*/
55
100
const DEFAULT_TEXT_SIZE = 1024 ;
56
101
102
+ /**
103
+ * Maximal TEXT columns sizes
104
+ * @api
105
+ */
57
106
const MAX_TEXT_SIZE = 2147483648 ;
58
107
108
+ /**
109
+ * Maximal BLOB columns sizes
110
+ * @api
111
+ */
59
112
const MAX_VARBINARY_SIZE = 2147483648 ;
60
113
61
114
/**
62
- * Default values for timestampses - fill with current timestamp on inserting record, on changing and both cases
115
+ * Default value for timestamps - fill with current timestamp on inserting record, on changing and both cases
116
+ * @api
63
117
*/
64
118
const TIMESTAMP_INIT_UPDATE = 'TIMESTAMP_INIT_UPDATE ' ;
65
119
120
+ /**
121
+ * Default value for timestamps - fill with current timestamp only on inserting record
122
+ * @api
123
+ */
66
124
const TIMESTAMP_INIT = 'TIMESTAMP_INIT ' ;
67
125
126
+ /**
127
+ * Default value for timestamps - fill with current timestamp only on changing record
128
+ * @api
129
+ */
68
130
const TIMESTAMP_UPDATE = 'TIMESTAMP_UPDATE ' ;
69
131
70
132
/**
71
- * Actions used for foreign keys
133
+ * Cascade action used for foreign keys
134
+ * @api
72
135
*/
73
136
const ACTION_CASCADE = 'CASCADE ' ;
74
137
138
+ /**
139
+ * Set null action used for foreign keys
140
+ * @api
141
+ */
75
142
const ACTION_SET_NULL = 'SET NULL ' ;
76
143
144
+ /**
145
+ * No action action used for foreign keys
146
+ * @api
147
+ */
77
148
const ACTION_NO_ACTION = 'NO ACTION ' ;
78
149
150
+ /**
151
+ * Restrict action used for foreign keys
152
+ * @api
153
+ */
79
154
const ACTION_RESTRICT = 'RESTRICT ' ;
80
155
156
+ /**
157
+ * Set default action used for foreign keys
158
+ * @api
159
+ */
81
160
const ACTION_SET_DEFAULT = 'SET DEFAULT ' ;
82
161
83
162
/**
@@ -182,6 +261,7 @@ class Table
182
261
*
183
262
* @param string $name
184
263
* @return $this
264
+ * @api
185
265
*/
186
266
public function setName ($ name )
187
267
{
@@ -197,6 +277,7 @@ public function setName($name)
197
277
*
198
278
* @param string $name
199
279
* @return $this
280
+ * @api
200
281
*/
201
282
public function setSchema ($ name )
202
283
{
@@ -209,6 +290,7 @@ public function setSchema($name)
209
290
*
210
291
* @param string $comment
211
292
* @return $this
293
+ * @api
212
294
*/
213
295
public function setComment ($ comment )
214
296
{
@@ -221,6 +303,7 @@ public function setComment($comment)
221
303
*
222
304
* @return string
223
305
* @throws \Zend_Db_Exception
306
+ * @api
224
307
*/
225
308
public function getName ()
226
309
{
@@ -234,6 +317,7 @@ public function getName()
234
317
* Get schema name
235
318
*
236
319
* @return string|null
320
+ * @api
237
321
*/
238
322
public function getSchema ()
239
323
{
@@ -244,6 +328,7 @@ public function getSchema()
244
328
* Return comment for table
245
329
*
246
330
* @return string
331
+ * @api
247
332
*/
248
333
public function getComment ()
249
334
{
@@ -273,6 +358,7 @@ public function getComment()
273
358
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
274
359
* @SuppressWarnings(PHPMD.NPathComplexity)
275
360
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
361
+ * @api
276
362
*/
277
363
public function addColumn ($ name , $ type , $ size = null , $ options = [], $ comment = null )
278
364
{
@@ -409,6 +495,7 @@ public function addColumn($name, $type, $size = null, $options = [], $comment =
409
495
* @return $this
410
496
* @throws \Zend_Db_Exception
411
497
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
498
+ * @api
412
499
*/
413
500
public function addForeignKey ($ fkName , $ column , $ refTable , $ refColumn , $ onDelete = null , $ onUpdate = null )
414
501
{
@@ -460,6 +547,7 @@ public function addForeignKey($fkName, $column, $refTable, $refColumn, $onDelete
460
547
* @return $this
461
548
* @throws \Zend_Db_Exception
462
549
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
550
+ * @api
463
551
*/
464
552
public function addIndex ($ indexName , $ fields , $ options = [])
465
553
{
@@ -527,6 +615,7 @@ public function addIndex($indexName, $fields, $options = [])
527
615
* @param bool $normalized
528
616
* @see $this->_columns
529
617
* @return array
618
+ * @api
530
619
*/
531
620
public function getColumns ($ normalized = true )
532
621
{
@@ -542,6 +631,7 @@ public function getColumns($normalized = true)
542
631
* @param array $column
543
632
* @see $this->_columns
544
633
* @return $this
634
+ * @api
545
635
*/
546
636
public function setColumn ($ column )
547
637
{
@@ -555,6 +645,7 @@ public function setColumn($column)
555
645
*
556
646
* @see $this->_indexes
557
647
* @return array
648
+ * @api
558
649
*/
559
650
public function getIndexes ()
560
651
{
@@ -566,6 +657,7 @@ public function getIndexes()
566
657
*
567
658
* @see $this->_foreignKeys
568
659
* @return array
660
+ * @api
569
661
*/
570
662
public function getForeignKeys ()
571
663
{
@@ -578,6 +670,7 @@ public function getForeignKeys()
578
670
* @param string $key
579
671
* @param string $value
580
672
* @return $this
673
+ * @api
581
674
*/
582
675
public function setOption ($ key , $ value )
583
676
{
@@ -591,6 +684,7 @@ public function setOption($key, $value)
591
684
*
592
685
* @param string $key
593
686
* @return null|string
687
+ * @api
594
688
*/
595
689
public function getOption ($ key )
596
690
{
@@ -604,6 +698,7 @@ public function getOption($key)
604
698
* Retrieve array of table options
605
699
*
606
700
* @return array
701
+ * @api
607
702
*/
608
703
public function getOptions ()
609
704
{
0 commit comments