1 | <?php |
||
10 | class Column { |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $field; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $type; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $collation; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $null; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $key; |
||
36 | |||
37 | /** |
||
38 | * @var null|string |
||
39 | */ |
||
40 | private $default; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $extra; |
||
46 | |||
47 | /** |
||
48 | * @param array $column Column information |
||
49 | */ |
||
50 | public function __construct($column) { |
||
51 | $this->field = $column['Field']; |
||
52 | $this->type = $column['Type']; |
||
53 | $this->collation = $column['Collation']; |
||
54 | $this->null = $column['Null']; |
||
55 | $this->key = $column['Key']; |
||
56 | $this->default = $column['Default']; |
||
57 | $this->extra = $column['Extra']; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Get Column field |
||
62 | * |
||
63 | * @return string Column field |
||
64 | */ |
||
65 | 3 | public function getField() { |
|
68 | |||
69 | /** |
||
70 | * Get Column collation |
||
71 | * |
||
72 | * @return string Column collation |
||
73 | */ |
||
74 | 3 | public function getCollation() { |
|
77 | |||
78 | /** |
||
79 | * Get has Column collation |
||
80 | * |
||
81 | * @return bool TRUE if Column has collation, otherwise FALSE |
||
82 | */ |
||
83 | public function hasCollation() { |
||
88 | |||
89 | /** |
||
90 | * Is Column primary key |
||
91 | * |
||
92 | * @return bool TRUE if primary key, otherwise FALSE |
||
93 | */ |
||
94 | 2 | public function isPrimaryKey() { |
|
99 | |||
100 | /** |
||
101 | * Is Column auto increment |
||
102 | * |
||
103 | * @return bool TRUE if auto increment, otherwise FALSE |
||
104 | */ |
||
105 | 2 | public function isAutoIncrement() { |
|
110 | |||
111 | /** |
||
112 | * Get result for column |
||
113 | * |
||
114 | * @return array Result |
||
115 | */ |
||
116 | 2 | public function getResult() { |
|
126 | |||
127 | /** |
||
128 | * Check auto increment column |
||
129 | * |
||
130 | * @param Column $column Table column |
||
131 | * |
||
132 | * @return array Result |
||
133 | */ |
||
134 | public function checkAutoIncrement(Column $column) { |
||
147 | } |
||
148 |