Conditions | 3 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 69 | public function getColumnsFromQuery($tableName, $query) |
|
27 | { |
||
28 | 69 | $columns = []; |
|
29 | |||
30 | try { |
||
31 | 69 | $information = $this->pdo->prepare($query); |
|
32 | |||
33 | 69 | $information->execute(); |
|
34 | 69 | $information->setFetchMode(\PDO::FETCH_OBJ); |
|
35 | 69 | } catch (\PDOException $e) { |
|
36 | // Table not found |
||
37 | } |
||
38 | |||
39 | 69 | while ($row = $information->fetch()) { |
|
40 | 63 | array_push($columns, $this->setColumn($tableName, $row)); |
|
41 | 63 | } |
|
42 | |||
43 | 69 | return $columns; |
|
44 | } |
||
45 | |||
55 |