1 | <?php |
||
5 | abstract class AbstractColumnDefinition |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $name = null; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $tableName = null; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $schemaName = null; |
||
21 | |||
22 | /** |
||
23 | * @var |
||
24 | */ |
||
25 | protected $ordinalPosition = null; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $columnDefault = null; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $dataType = null; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $nativeDataType = null; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $alias; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $tableAlias; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $catalog; |
||
56 | |||
57 | /** |
||
58 | * @var bool |
||
59 | */ |
||
60 | protected $isPrimary = false; |
||
61 | |||
62 | /** |
||
63 | * @var bool |
||
64 | */ |
||
65 | protected $isNullable = false; |
||
66 | |||
67 | /** |
||
68 | * @var bool |
||
69 | */ |
||
70 | protected $isGroup = false; |
||
71 | |||
72 | /** |
||
73 | * Constructor. |
||
74 | * |
||
75 | * @param string $name |
||
76 | * @param string $tableName |
||
77 | * @param string $schemaName |
||
78 | */ |
||
79 | public function __construct($name, $tableName = null, $schemaName = null) |
||
85 | |||
86 | /** |
||
87 | * Set name. |
||
88 | * |
||
89 | * @param string $name |
||
90 | * |
||
91 | * @return AbstractColumnDefinition |
||
92 | */ |
||
93 | public function setName($name) |
||
99 | 3 | ||
100 | /** |
||
101 | * Get name. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getName() |
||
109 | 3 | ||
110 | 3 | /** |
|
111 | * Get table name. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getTableName() |
||
119 | |||
120 | 2 | /** |
|
121 | * Set table name. |
||
122 | * |
||
123 | * @param string $tableName |
||
124 | * |
||
125 | * @return AbstractColumnDefinition |
||
126 | */ |
||
127 | public function setTableName($tableName) |
||
136 | |||
137 | /** |
||
138 | * Set schema name. |
||
139 | 3 | * |
|
140 | * @param string $schemaName |
||
141 | 3 | * |
|
142 | 1 | * @return AbstractColumnDefinition |
|
143 | 1 | */ |
|
144 | 3 | public function setSchemaName($schemaName) |
|
153 | |||
154 | 3 | /** |
|
155 | * Get schema name. |
||
156 | 3 | * |
|
157 | 2 | * @return string |
|
158 | 2 | */ |
|
159 | 3 | public function getSchemaName() |
|
163 | |||
164 | /** |
||
165 | * @return int $ordinalPosition |
||
166 | */ |
||
167 | public function getOrdinalPosition() |
||
171 | |||
172 | /** |
||
173 | * @param int $ordinalPosition to set |
||
174 | * |
||
175 | * @return AbstractColumnDefinition |
||
176 | 1 | */ |
|
177 | public function setOrdinalPosition($ordinalPosition) |
||
183 | |||
184 | /** |
||
185 | 1 | * @return null|string the $columnDefault |
|
186 | */ |
||
187 | 1 | public function getColumnDefault() |
|
191 | |||
192 | /** |
||
193 | * @param string $columnDefault to set |
||
194 | 1 | * |
|
195 | * @return AbstractColumnDefinition |
||
196 | 1 | */ |
|
197 | public function setColumnDefault($columnDefault) |
||
203 | 1 | ||
204 | /** |
||
205 | 1 | * @param bool $isNullable to set |
|
206 | 1 | * |
|
207 | * @return AbstractColumnDefinition |
||
208 | */ |
||
209 | public function setIsNullable($isNullable) |
||
215 | |||
216 | 1 | /** |
|
217 | 1 | * @return bool $isNullable |
|
218 | */ |
||
219 | public function isNullable() |
||
223 | 1 | ||
224 | /** |
||
225 | 1 | * @param bool $isPrimary to set |
|
226 | * |
||
227 | * @return AbstractColumnDefinition |
||
228 | */ |
||
229 | public function setIsPrimary($isPrimary) |
||
235 | 1 | ||
236 | 1 | /** |
|
237 | * @return bool $isPrimary |
||
238 | */ |
||
239 | public function isPrimary() |
||
243 | |||
244 | 1 | /** |
|
245 | * @return null|string the $dataType |
||
246 | */ |
||
247 | public function getDataType() |
||
251 | |||
252 | /** |
||
253 | * @param string $dataType the $dataType to set |
||
254 | * |
||
255 | * @return AbstractColumnDefinition |
||
256 | */ |
||
257 | public function setDataType($dataType) |
||
263 | |||
264 | /** |
||
265 | * @return null|string the $nativeDataType |
||
266 | */ |
||
267 | public function getNativeDataType() |
||
271 | |||
272 | /** |
||
273 | * @param string $nativeDataType the $dataType to set |
||
274 | * |
||
275 | * @return AbstractColumnDefinition |
||
276 | */ |
||
277 | public function setNativeDataType($nativeDataType) |
||
283 | |||
284 | /** |
||
285 | * @param string $alias column alias name |
||
286 | * |
||
287 | * @return AbstractColumnDefinition |
||
288 | */ |
||
289 | public function setAlias($alias) |
||
295 | |||
296 | /** |
||
297 | * @return string column alais |
||
298 | */ |
||
299 | public function getAlias() |
||
303 | |||
304 | /** |
||
305 | * @param string $tableAlias table alias name |
||
306 | * |
||
307 | * @return AbstractColumnDefinition |
||
308 | */ |
||
309 | public function setTableAlias($tableAlias) |
||
318 | |||
319 | /** |
||
320 | * @return string table alias |
||
321 | */ |
||
322 | public function getTableAlias() |
||
326 | |||
327 | /** |
||
328 | * @param string $catalog db catalog |
||
329 | * |
||
330 | * @return AbstractColumnDefinition |
||
331 | */ |
||
332 | public function setCatalog($catalog) |
||
338 | |||
339 | /** |
||
340 | * @return string catalog |
||
341 | */ |
||
342 | public function getCatalog() |
||
346 | |||
347 | /** |
||
348 | * @param bool $isGroup when the column is grouped |
||
349 | * |
||
350 | * @return AbstractColumnDefinition |
||
351 | */ |
||
352 | public function setIsGroup($isGroup) |
||
358 | |||
359 | /** |
||
360 | * Whether the column originates from a sql group function. |
||
361 | * |
||
362 | * @return bool |
||
363 | */ |
||
364 | public function isGroup() |
||
368 | |||
369 | /** |
||
370 | * @return bool |
||
371 | */ |
||
372 | public function isComputed() |
||
376 | |||
377 | /** |
||
378 | * Tells whether the column is numeric. |
||
379 | * |
||
380 | * @return bool |
||
381 | */ |
||
382 | public function isNumeric() |
||
386 | |||
387 | /** |
||
388 | * Tells whether the column is textual. |
||
389 | * |
||
390 | * @return bool |
||
391 | */ |
||
392 | public function isText() |
||
396 | |||
397 | /** |
||
398 | * Tells whether the column is a date. |
||
399 | * |
||
400 | * @return bool |
||
401 | */ |
||
402 | public function isDate() |
||
406 | |||
407 | /** |
||
408 | * Tells whether the column is a timestamp. |
||
409 | * |
||
410 | * @return bool |
||
411 | */ |
||
412 | public function isDatetime() |
||
416 | |||
417 | /** |
||
418 | * Return an array version of the column definition. |
||
419 | * |
||
420 | * @return array |
||
421 | */ |
||
422 | public function toArray() |
||
436 | } |
||
437 |