1 | <?php |
||
8 | class Type |
||
9 | { |
||
10 | const TYPE_INTEGER = 'integer'; |
||
11 | const TYPE_DECIMAL = 'decimal'; |
||
12 | const TYPE_STRING = 'string'; |
||
13 | const TYPE_BOOLEAN = 'boolean'; |
||
14 | const TYPE_DATETIME = 'datetime'; |
||
15 | const TYPE_BLOB = 'blob'; |
||
16 | const TYPE_DATE = 'date'; |
||
17 | const TYPE_TIME = 'time'; |
||
18 | const TYPE_FLOAT = 'float'; |
||
19 | const TYPE_BIT = 'bit'; |
||
20 | const TYPE_SPATIAL_GEOMETRY = 'geometry'; |
||
21 | const TYPE_NULL = 'null'; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected static $typesMap = [ |
||
27 | self::TYPE_INTEGER => 'Definition\IntegerColumn', |
||
28 | self::TYPE_DECIMAL => 'Definition\DecimalColumn', |
||
29 | self::TYPE_STRING => 'Definition\StringColumn', |
||
30 | self::TYPE_BOOLEAN => 'Definition\BooleanColumn', |
||
31 | self::TYPE_DATETIME => 'Definition\DatetimeColumn', |
||
32 | self::TYPE_BLOB => 'Definition\BlobColumn', |
||
33 | self::TYPE_DATE => 'Definition\DateColumn', |
||
34 | self::TYPE_TIME => 'Definition\TimeColumn', |
||
35 | self::TYPE_FLOAT => 'Definition\FloatColumn', |
||
36 | self::TYPE_BIT => 'Definition\BitColumn', |
||
37 | self::TYPE_SPATIAL_GEOMETRY => 'Definition\GeometryColumn', |
||
38 | self::TYPE_NULL => 'Definition\NullColumn' |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * @param string $datatype |
||
43 | * @param string $name |
||
44 | * @param string $tableName |
||
45 | * @param string $schemaName |
||
46 | * |
||
47 | * @throws Exception\UnsupportedDatatypeException |
||
48 | * |
||
49 | * @return AbstractColumnDefinition |
||
50 | 2 | */ |
|
51 | public static function createColumnDefinition($datatype, $name, $tableName = null, $schemaName = null) |
||
60 | |||
61 | /** |
||
62 | * Return all supported types. |
||
63 | * |
||
64 | * @return array |
||
65 | 1 | */ |
|
66 | public static function getSupportedTypes() |
||
70 | } |
||
71 |