| @@ 169-186 (lines=18) @@ | ||
| 166 | * |
|
| 167 | * @see Alpha\Model\ActiveRecordProviderInterface::query() |
|
| 168 | */ |
|
| 169 | public function query($sqlQuery) |
|
| 170 | { |
|
| 171 | $this->BO->setLastQuery($sqlQuery); |
|
| 172 | ||
| 173 | $resultArray = array(); |
|
| 174 | ||
| 175 | if (!$result = self::getConnection()->query($sqlQuery)) { |
|
| 176 | throw new CustomQueryException('Failed to run the custom query, MySql error is ['.self::getConnection()->error.'], query ['.$sqlQuery.']'); |
|
| 177 | ||
| 178 | return array(); |
|
| 179 | } else { |
|
| 180 | while ($row = $result->fetch_array(MYSQLI_ASSOC)) { |
|
| 181 | array_push($resultArray, $row); |
|
| 182 | } |
|
| 183 | ||
| 184 | return $resultArray; |
|
| 185 | } |
|
| 186 | } |
|
| 187 | ||
| 188 | /** |
|
| 189 | * (non-PHPdoc). |
|
| @@ 170-187 (lines=18) @@ | ||
| 167 | * |
|
| 168 | * @see Alpha\Model\ActiveRecordProviderInterface::query() |
|
| 169 | */ |
|
| 170 | public function query($sqlQuery) |
|
| 171 | { |
|
| 172 | $this->BO->setLastQuery($sqlQuery); |
|
| 173 | ||
| 174 | $resultArray = array(); |
|
| 175 | ||
| 176 | if (!$result = self::getConnection()->query($sqlQuery)) { |
|
| 177 | throw new CustomQueryException('Failed to run the custom query, SQLite error is ['.self::getLastDatabaseError().'], query ['.$sqlQuery.']'); |
|
| 178 | ||
| 179 | return array(); |
|
| 180 | } else { |
|
| 181 | while ($row = $result->fetchArray(SQLITE3_ASSOC)) { |
|
| 182 | array_push($resultArray, $row); |
|
| 183 | } |
|
| 184 | ||
| 185 | return $resultArray; |
|
| 186 | } |
|
| 187 | } |
|
| 188 | ||
| 189 | /** |
|
| 190 | * (non-PHPdoc). |
|