Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
44 | 3 | public function query($query, $resultsetType = Resultset::TYPE_ARRAY) |
|
45 | { |
||
46 | try { |
||
47 | 3 | $stmt = $this->zendAdapter->createStatement($query); |
|
48 | 3 | $r = $stmt->execute(); |
|
49 | 3 | $results = new Resultset($resultsetType); |
|
50 | 3 | if ($r->getFieldCount() > 0) { |
|
51 | 2 | foreach ($r as $row) { |
|
52 | 2 | $results->append($row); |
|
53 | } |
||
54 | } |
||
55 | 3 | unset($r); |
|
56 | 2 | } catch (\Exception $e) { |
|
57 | 2 | $msg = "ZendDb2 adapter query error: {$e->getMessage()} [$query]"; |
|
58 | 2 | throw new Exception\InvalidArgumentException($msg); |
|
59 | } |
||
60 | |||
61 | 3 | return $results; |
|
62 | } |
||
63 | |||
74 |