1 | <?php |
||
13 | class Column |
||
14 | { |
||
15 | |||
16 | const TypeNone = 0; |
||
17 | const TypePHP = 1; |
||
18 | const TypeDefault = 2; |
||
19 | |||
20 | /** |
||
21 | * Colunas dos bancos |
||
22 | * |
||
23 | * @author Pedro Alarcao <[email protected]> |
||
24 | */ |
||
25 | final private function __construct () |
||
28 | |||
29 | /** |
||
30 | * create instance |
||
31 | * |
||
32 | * @return \Classes\Db\Column |
||
33 | */ |
||
34 | public static function getInstance () |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $name; |
||
43 | |||
44 | /** |
||
45 | * @var \Classes\Db\Constrant[] |
||
46 | */ |
||
47 | private $primarykey; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $type; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | private $comment; |
||
58 | |||
59 | /** |
||
60 | * @var boolean |
||
61 | */ |
||
62 | private $nullable; |
||
63 | |||
64 | /** |
||
65 | * @var int |
||
66 | */ |
||
67 | private $max_length; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | private $column_default; |
||
73 | |||
74 | /** |
||
75 | * @var \Classes\Db\Constrant[] |
||
76 | */ |
||
77 | private $dependences; |
||
78 | |||
79 | /** |
||
80 | * @var \Classes\Db\Constrant |
||
81 | */ |
||
82 | private $refForeingkey; |
||
83 | |||
84 | /** |
||
85 | * @type string |
||
86 | */ |
||
87 | private $sequence; |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getName () |
||
96 | |||
97 | /** |
||
98 | * popula o |
||
99 | * |
||
100 | * @param $array |
||
101 | */ |
||
102 | public function populate ( $array ) |
||
112 | |||
113 | /** |
||
114 | * @return boolean |
||
115 | */ |
||
116 | public function isPrimaryKey () |
||
120 | |||
121 | /** |
||
122 | * @return boolean |
||
123 | */ |
||
124 | public function isForeingkey () |
||
128 | |||
129 | /** |
||
130 | * @return boolean |
||
131 | */ |
||
132 | public function hasDependence () |
||
136 | |||
137 | /** |
||
138 | * @return boolean |
||
139 | */ |
||
140 | public function hasColumnDefault () |
||
144 | |||
145 | /** |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getColumnDefault () |
||
152 | |||
153 | /** |
||
154 | * @return string |
||
155 | */ |
||
156 | public function getType ( $type = self::TypeDefault ) |
||
168 | |||
169 | /** |
||
170 | * @param $type |
||
171 | * @param bool $inPHP |
||
172 | * |
||
173 | * @return bool |
||
174 | */ |
||
175 | public function equalType ( $type, $inPHP = true ) |
||
179 | |||
180 | /** |
||
181 | * @param AbstractAdapter $type |
||
182 | * |
||
183 | * @return mixed |
||
184 | */ |
||
185 | public function getTypeByConfig ( AbstractAdapter $type ) |
||
189 | |||
190 | /** |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getComment () |
||
197 | |||
198 | /** |
||
199 | * @param string $comment |
||
200 | */ |
||
201 | public function setComment ( $comment ) |
||
207 | |||
208 | /** |
||
209 | * @param \Classes\Db\Constrant $primarykey |
||
210 | */ |
||
211 | public function setPrimaryKey ( Constrant $primarykey ) |
||
217 | |||
218 | /** |
||
219 | * @param \Classes\Db\Constrant $dependece |
||
220 | */ |
||
221 | public function addDependece ( Constrant $dependece ) |
||
227 | |||
228 | /** |
||
229 | * @param $constraint_name |
||
230 | * @param $table_name |
||
231 | * @param $column_name |
||
232 | * |
||
233 | * @return $this |
||
234 | */ |
||
235 | public function createDependece ( $constraint_name, $table_name, $column_name, $database, $schema = null ) |
||
252 | |||
253 | /** |
||
254 | * @param \Classes\Db\Constrant $reference |
||
255 | */ |
||
256 | public function addRefFk ( Constrant $reference ) |
||
262 | |||
263 | /** |
||
264 | * retorna as foreingkeys |
||
265 | * |
||
266 | * @return \Classes\Db\Constrant |
||
267 | */ |
||
268 | public function getFks () |
||
272 | |||
273 | /** |
||
274 | * Retorna as dependencias da tabela |
||
275 | * |
||
276 | * @return \Classes\Db\Constrant[] |
||
277 | */ |
||
278 | public function getDependences () |
||
282 | |||
283 | /** |
||
284 | * @return bool |
||
285 | */ |
||
286 | public function hasDependences () |
||
290 | |||
291 | /** |
||
292 | * Retorna a constrant da primarykey da tabela |
||
293 | * |
||
294 | * @return \Classes\Db\Constrant[] |
||
295 | */ |
||
296 | public function getPrimaryKey () |
||
300 | |||
301 | /** |
||
302 | * |
||
303 | */ |
||
304 | public function getMaxLength () |
||
308 | |||
309 | /** |
||
310 | * @return bool |
||
311 | */ |
||
312 | public function hasSequence () |
||
316 | |||
317 | /** |
||
318 | * @return string |
||
319 | */ |
||
320 | public function getSequence () |
||
324 | |||
325 | /** |
||
326 | * @param string $sequence |
||
327 | */ |
||
328 | public function setSequence ( $sequence ) |
||
332 | |||
333 | /** |
||
334 | * @return boolean |
||
335 | */ |
||
336 | public function isNullable () |
||
340 | |||
341 | } |
||
342 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: