Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | protected function getTableFields($table) |
||
24 | { |
||
25 | $result = $this->db->execute("pragma table_info(`{$table}`)")->fetchAll(PDO::FETCH_ASSOC); |
||
26 | $fields = []; |
||
27 | |||
28 | foreach ($result as $field) { |
||
29 | $name = $field['name']; |
||
30 | |||
31 | $fields[$name] = [ |
||
32 | 'type' => strtolower($field['type']), |
||
33 | 'null' => ($field['notnull'] !== '1'), |
||
34 | 'default' => $field['dflt_value'], |
||
35 | 'unsigned' => null, |
||
36 | 'length' => null, |
||
37 | 'values' => null, |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | return $fields; |
||
42 | } |
||
43 | } |
||
44 |