| @@ 195-214 (lines=20) @@ | ||
| 192 | * |
|
| 193 | * @return array |
|
| 194 | */ |
|
| 195 | public function fetchAllArray() |
|
| 196 | { |
|
| 197 | // init |
|
| 198 | $data = array(); |
|
| 199 | ||
| 200 | if ( |
|
| 201 | $this->_result |
|
| 202 | && |
|
| 203 | !$this->is_empty() |
|
| 204 | ) { |
|
| 205 | $this->reset(); |
|
| 206 | ||
| 207 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 208 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 209 | $data[] = $this->cast($row); |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||
| 213 | return $data; |
|
| 214 | } |
|
| 215 | ||
| 216 | /** |
|
| 217 | * Fetch all results as "Arrayy"-object. |
|
| @@ 221-240 (lines=20) @@ | ||
| 218 | * |
|
| 219 | * @return Arrayy |
|
| 220 | */ |
|
| 221 | public function fetchAllArrayy() |
|
| 222 | { |
|
| 223 | // init |
|
| 224 | $data = array(); |
|
| 225 | ||
| 226 | if ( |
|
| 227 | $this->_result |
|
| 228 | && |
|
| 229 | !$this->is_empty() |
|
| 230 | ) { |
|
| 231 | $this->reset(); |
|
| 232 | ||
| 233 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 234 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 235 | $data[] = $this->cast($row); |
|
| 236 | } |
|
| 237 | } |
|
| 238 | ||
| 239 | return Arrayy::create($data); |
|
| 240 | } |
|
| 241 | ||
| 242 | /** |
|
| 243 | * Check if the result is empty. |
|