1 | <?php |
||
5 | abstract class AbstractColumnDefinition |
||
6 | { |
||
7 | /** |
||
8 | * |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $name = null; |
||
12 | |||
13 | /** |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $tableName = null; |
||
18 | |||
19 | /** |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $schemaName = null; |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | * @var |
||
28 | */ |
||
29 | protected $ordinalPosition = null; |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $columnDefault = null; |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * @var bool |
||
40 | */ |
||
41 | protected $isNullable = null; |
||
42 | |||
43 | /** |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $dataType = null; |
||
48 | |||
49 | /** |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $nativeDataType = null; |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @var string |
||
58 | */ |
||
59 | protected $alias; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $tableAlias; |
||
65 | |||
66 | /** |
||
67 | * @var string |
||
68 | */ |
||
69 | protected $catalog; |
||
70 | |||
71 | /** |
||
72 | * |
||
73 | * @var boolean |
||
74 | */ |
||
75 | protected $isPrimary = false; |
||
76 | |||
77 | /** |
||
78 | * |
||
79 | * @var boolean |
||
80 | */ |
||
81 | protected $isGroup = false; |
||
82 | |||
83 | |||
84 | |||
85 | |||
86 | /** |
||
87 | * Constructor |
||
88 | * |
||
89 | * @param string $name |
||
90 | * @param string $tableName |
||
91 | * @param string $schemaName |
||
92 | */ |
||
93 | public function __construct($name, $tableName = null, $schemaName = null) |
||
99 | |||
100 | /** |
||
101 | * Set name |
||
102 | * |
||
103 | * @param string $name |
||
104 | * @return AbstractColumnDefinition |
||
105 | */ |
||
106 | public function setName($name) |
||
111 | |||
112 | /** |
||
113 | * Get name |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getName() |
||
121 | |||
122 | /** |
||
123 | * Get table name |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | public function getTableName() |
||
131 | |||
132 | /** |
||
133 | * Set table name |
||
134 | * |
||
135 | * @param string $tableName |
||
136 | * @return AbstractColumnDefinition |
||
137 | */ |
||
138 | public function setTableName($tableName) |
||
146 | |||
147 | /** |
||
148 | * Set schema name |
||
149 | * |
||
150 | * @param string $schemaName |
||
151 | * @return AbstractColumnDefinition |
||
152 | */ |
||
153 | public function setSchemaName($schemaName) |
||
161 | |||
162 | /** |
||
163 | * Get schema name |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | public function getSchemaName() |
||
171 | |||
172 | /** |
||
173 | * @return int $ordinalPosition |
||
174 | */ |
||
175 | public function getOrdinalPosition() |
||
179 | |||
180 | /** |
||
181 | * @param int $ordinalPosition to set |
||
182 | * @return AbstractColumnDefinition |
||
183 | */ |
||
184 | public function setOrdinalPosition($ordinalPosition) |
||
189 | |||
190 | /** |
||
191 | * @return null|string the $columnDefault |
||
192 | */ |
||
193 | public function getColumnDefault() |
||
197 | |||
198 | /** |
||
199 | * @param string $columnDefault to set |
||
200 | * @return AbstractColumnDefinition |
||
201 | */ |
||
202 | public function setColumnDefault($columnDefault) |
||
207 | |||
208 | |||
209 | /** |
||
210 | * @param bool $isNullable to set |
||
211 | * @return AbstractColumnDefinition |
||
212 | */ |
||
213 | public function setIsNullable($isNullable) |
||
218 | |||
219 | /** |
||
220 | * @return bool $isNullable |
||
221 | */ |
||
222 | public function isNullable() |
||
226 | |||
227 | |||
228 | /** |
||
229 | * @param bool $isPrimary to set |
||
230 | * @return AbstractColumnDefinition |
||
231 | */ |
||
232 | public function setIsPrimary($isPrimary) |
||
237 | |||
238 | /** |
||
239 | * @return bool $isPrimary |
||
240 | */ |
||
241 | public function isPrimary() |
||
245 | |||
246 | /** |
||
247 | * @return null|string the $dataType |
||
248 | */ |
||
249 | public function getDataType() |
||
253 | |||
254 | /** |
||
255 | * @param string $dataType the $dataType to set |
||
256 | * @return AbstractColumnDefinition |
||
257 | */ |
||
258 | public function setDataType($dataType) |
||
263 | |||
264 | |||
265 | /** |
||
266 | * @return null|string the $nativeDataType |
||
267 | */ |
||
268 | public function getNativeDataType() |
||
272 | |||
273 | |||
274 | |||
275 | /** |
||
276 | * @param string $nativeDataType the $dataType to set |
||
277 | * @return AbstractColumnDefinition |
||
278 | */ |
||
279 | public function setNativeDataType($nativeDataType) |
||
284 | |||
285 | |||
286 | /** |
||
287 | * |
||
288 | * @param string $alias column alias name |
||
289 | * @return AbstractColumnDefinition |
||
290 | */ |
||
291 | public function setAlias($alias) |
||
296 | |||
297 | /** |
||
298 | * @return string column alais |
||
299 | */ |
||
300 | public function getAlias() |
||
304 | |||
305 | /** |
||
306 | * |
||
307 | * @param string $tableAlias table alias name |
||
308 | * @return AbstractColumnDefinition |
||
309 | */ |
||
310 | public function setTableAlias($tableAlias) |
||
318 | |||
319 | /** |
||
320 | * |
||
321 | * @return string table alias |
||
322 | */ |
||
323 | public function getTableAlias() |
||
327 | |||
328 | /** |
||
329 | * |
||
330 | * @param string $catalog db catalog |
||
331 | * @return AbstractColumnDefinition |
||
332 | */ |
||
333 | public function setCatalog($catalog) |
||
338 | |||
339 | /** |
||
340 | * @return string catalog |
||
341 | */ |
||
342 | public function getCatalog() |
||
346 | |||
347 | |||
348 | |||
349 | /** |
||
350 | * @param bool $isGroup when the column is grouped |
||
351 | * @return AbstractColumnDefinition |
||
352 | */ |
||
353 | public function setIsGroup($isGroup) |
||
358 | |||
359 | /** |
||
360 | * @return bool $isGroup |
||
361 | */ |
||
362 | public function isGroup() |
||
366 | |||
367 | |||
368 | /** |
||
369 | * @return boolean |
||
370 | */ |
||
371 | public function isComputed() |
||
375 | |||
376 | |||
377 | /** |
||
378 | * Tells whether the column is numeric |
||
379 | * |
||
380 | * @return boolean |
||
381 | */ |
||
382 | public function isNumeric() |
||
386 | |||
387 | /** |
||
388 | * Tells whether the column is textual |
||
389 | * |
||
390 | * @return boolean |
||
391 | */ |
||
392 | public function isText() |
||
396 | |||
397 | /** |
||
398 | * Tells whether the column is a date |
||
399 | * |
||
400 | * @return boolean |
||
401 | */ |
||
402 | public function isDate() |
||
406 | |||
407 | /** |
||
408 | * Tells whether the column is a timestamp |
||
409 | * |
||
410 | * @return boolean |
||
411 | */ |
||
412 | public function isDatetime() |
||
416 | |||
417 | /** |
||
418 | * Return an array version of the column definition |
||
419 | * @return array |
||
420 | */ |
||
421 | public function toArray() |
||
434 | } |
||
435 |