Conditions | 4 |
Paths | 16 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
29 | protected function query($table, $query, $columns = array()) |
||
30 | { |
||
31 | 69 | try { |
|
32 | $result = $this->pdo->prepare($query); |
||
33 | 69 | ||
34 | 69 | $result->execute(); |
|
35 | 69 | ||
36 | $result->setFetchMode(\PDO::FETCH_OBJ); |
||
37 | } catch (\PDOException $error) { |
||
38 | $this->exception($table, $error->getMessage()); |
||
39 | 69 | } |
|
40 | 63 | ||
41 | 63 | while ($row = $result->fetch()) { |
|
42 | $column = $this->column(new Column, $table, $row); |
||
43 | 69 | ||
44 | array_push($columns, $column); |
||
45 | } |
||
46 | |||
47 | empty($columns) && $this->exception($table); |
||
48 | |||
49 | return $columns; |
||
50 | } |
||
51 | |||
69 |