1 | <?php |
||
13 | class Column |
||
14 | { |
||
15 | /** |
||
16 | * @var boolean |
||
17 | */ |
||
18 | protected $autoIncrement = FALSE; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $dataType; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $defaultValue = ''; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $field; |
||
34 | |||
35 | /** |
||
36 | * @var boolean |
||
37 | */ |
||
38 | protected $foreign = FALSE; |
||
39 | |||
40 | /** |
||
41 | * @var integer |
||
42 | */ |
||
43 | protected $length = 0; |
||
44 | |||
45 | /** |
||
46 | * @var boolean |
||
47 | */ |
||
48 | protected $null = FALSE; |
||
49 | |||
50 | /** |
||
51 | * @var boolean |
||
52 | */ |
||
53 | protected $primary = FALSE; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $referencedField; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $referencedTable; |
||
64 | |||
65 | /** |
||
66 | * @var boolean |
||
67 | */ |
||
68 | protected $unique = FALSE; |
||
69 | |||
70 | /** |
||
71 | * @var boolean |
||
72 | */ |
||
73 | protected $unsigned = FALSE; |
||
74 | |||
75 | /** |
||
76 | * Gets the data type. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getDataType() |
||
84 | |||
85 | /** |
||
86 | * Gets the default value. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getDefaultValue() |
||
94 | |||
95 | /** |
||
96 | * Gets the column description. |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getField() |
||
104 | |||
105 | /** |
||
106 | * Gets the foreign field. |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getReferencedField() |
||
114 | |||
115 | /** |
||
116 | * Gets the foreign table. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getReferencedTable() |
||
124 | |||
125 | /** |
||
126 | * Gets the field's length. |
||
127 | * |
||
128 | * @return integer |
||
129 | */ |
||
130 | public function getLength() |
||
134 | |||
135 | /** |
||
136 | * Gets the data type. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function get_data_type() |
||
144 | |||
145 | /** |
||
146 | * Gets the default value. |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public function get_default_value() |
||
154 | |||
155 | /** |
||
156 | * Gets the column description. |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | 6 | public function get_field() |
|
164 | |||
165 | /** |
||
166 | * Gets the foreign field. |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function get_referenced_field() |
||
174 | |||
175 | /** |
||
176 | * Gets the foreign table. |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | public function get_referenced_table() |
||
184 | |||
185 | /** |
||
186 | * Gets the field's length. |
||
187 | * |
||
188 | * @return string |
||
189 | */ |
||
190 | public function get_length() |
||
194 | |||
195 | /** |
||
196 | * Check if the field is an auto incrementing field |
||
197 | * |
||
198 | * @return boolean |
||
199 | */ |
||
200 | public function isAutoIncrement() |
||
204 | |||
205 | /** |
||
206 | * Check if the field is a foreign key |
||
207 | * |
||
208 | * @return boolean |
||
209 | */ |
||
210 | public function isForeignKey() |
||
214 | |||
215 | /** |
||
216 | * Check if the field accept NULL values |
||
217 | * |
||
218 | * @return boolean |
||
219 | */ |
||
220 | public function isNull() |
||
224 | |||
225 | /** |
||
226 | * Check if the field is a primary key |
||
227 | * |
||
228 | * @return boolean |
||
229 | */ |
||
230 | 6 | public function isPrimaryKey() |
|
234 | |||
235 | /** |
||
236 | * Check if field is unique |
||
237 | * |
||
238 | * @return boolean |
||
239 | */ |
||
240 | public function isUnique() |
||
244 | |||
245 | /** |
||
246 | * Check if field is unsigned |
||
247 | * |
||
248 | * @return boolean |
||
249 | */ |
||
250 | public function isUnsigned() |
||
254 | |||
255 | /** |
||
256 | * Check if the field is an auto incrementing field |
||
257 | * |
||
258 | * @return boolean |
||
259 | */ |
||
260 | public function is_auto_increment() |
||
264 | |||
265 | /** |
||
266 | * Check if the field is a foreign key |
||
267 | * |
||
268 | * @return boolean |
||
269 | */ |
||
270 | public function is_foreign_key() |
||
274 | |||
275 | /** |
||
276 | * Check if the field accept NULL values |
||
277 | * |
||
278 | * @return boolean |
||
279 | */ |
||
280 | public function is_null() |
||
284 | |||
285 | /** |
||
286 | * Check if the field is a primary key |
||
287 | * |
||
288 | * @return boolean |
||
289 | */ |
||
290 | public function is_primary_key() |
||
294 | |||
295 | /** |
||
296 | * Check if field is unique |
||
297 | * |
||
298 | * @return boolean |
||
299 | */ |
||
300 | public function is_unique() |
||
304 | |||
305 | /** |
||
306 | * Check if field is unsigned |
||
307 | * |
||
308 | * @return boolean |
||
309 | */ |
||
310 | public function is_unsigned() |
||
314 | |||
315 | /** |
||
316 | * Sets the auto increment. |
||
317 | * |
||
318 | * @param boolean $autoIncrement |
||
319 | */ |
||
320 | 12 | public function setAutoIncrement($autoIncrement) |
|
326 | |||
327 | /** |
||
328 | * Sets the data type. |
||
329 | * |
||
330 | * @param string $dataType |
||
331 | */ |
||
332 | 12 | public function setDataType($dataType) |
|
348 | |||
349 | /** |
||
350 | * Sets the default value. |
||
351 | * |
||
352 | * @param string $defaultValue |
||
353 | */ |
||
354 | 12 | public function setDefaultValue($defaultValue) |
|
360 | |||
361 | /** |
||
362 | * Sets the column's description. |
||
363 | * |
||
364 | * @param string $field |
||
365 | */ |
||
366 | 12 | public function setField($field) |
|
372 | |||
373 | /** |
||
374 | * Sets the field as a foreign key. |
||
375 | * |
||
376 | * @param boolean $foreign |
||
377 | */ |
||
378 | public function setForeign($foreign) |
||
384 | |||
385 | /** |
||
386 | * Sets the foreign field. |
||
387 | * |
||
388 | * @param string $referencedField |
||
389 | */ |
||
390 | public function setReferencedField($referencedField) |
||
396 | |||
397 | /** |
||
398 | * Sets the foreign table. |
||
399 | * |
||
400 | * @param string $foreignTable |
||
401 | */ |
||
402 | public function setReferencedTable($foreignTable) |
||
408 | |||
409 | /** |
||
410 | * Sets the field's length. |
||
411 | * |
||
412 | * @param integer $length |
||
413 | */ |
||
414 | public function setLength($length) |
||
420 | |||
421 | /** |
||
422 | * Sets if field accepts NULL values. |
||
423 | * |
||
424 | * @param boolean $null |
||
425 | */ |
||
426 | 12 | public function setNull($null = TRUE) |
|
432 | |||
433 | /** |
||
434 | * Sets if field is a primary key. |
||
435 | * |
||
436 | * @param boolean $primary |
||
437 | */ |
||
438 | 12 | public function setPrimary($primary = TRUE) |
|
444 | |||
445 | /** |
||
446 | * Sets if field is a unique key. |
||
447 | * |
||
448 | * @param boolean $unique |
||
449 | */ |
||
450 | public function setUnique($unique = TRUE) |
||
456 | |||
457 | /** |
||
458 | * Sets if field is an unsigned key. |
||
459 | * |
||
460 | * @param boolean $unsigned |
||
461 | */ |
||
462 | public function setUnsigned($unsigned = TRUE) |
||
468 | } |
||
469 |