Conditions | 5 |
Paths | 7 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
50 | public function query($query) |
||
51 | { |
||
52 | try { |
||
53 | $r = $this->zendAdapter->query($query, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE); |
||
54 | $results = new Resultset(); |
||
55 | if ($r === false) { |
||
56 | throw new Exception\InvalidArgumentException("Query cannot be executed [$query]."); |
||
57 | } elseif ($r instanceof \Zend\Db\ResultSet\ResultSet) { |
||
58 | foreach ($r as $row) { |
||
59 | $results->append((array) $row); |
||
60 | } |
||
61 | } |
||
62 | } catch (\Exception $e) { |
||
63 | $msg = "ZendDb2 adapter query error: {$e->getMessage()} [$query]"; |
||
64 | throw new Exception\InvalidArgumentException($msg); |
||
65 | } |
||
66 | return $results; |
||
67 | } |
||
68 | |||
78 |