| @@ 311-330 (lines=20) @@ | ||
| 308 | * |
|
| 309 | * @return array |
|
| 310 | */ |
|
| 311 | public function fetchAllArray() |
|
| 312 | { |
|
| 313 | // init |
|
| 314 | $data = array(); |
|
| 315 | ||
| 316 | if ( |
|
| 317 | $this->_result |
|
| 318 | && |
|
| 319 | !$this->is_empty() |
|
| 320 | ) { |
|
| 321 | $this->reset(); |
|
| 322 | ||
| 323 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 324 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 325 | $data[] = $this->cast($row); |
|
| 326 | } |
|
| 327 | } |
|
| 328 | ||
| 329 | return $data; |
|
| 330 | } |
|
| 331 | ||
| 332 | /** |
|
| 333 | * Fetch all results as "Arrayy"-object. |
|
| @@ 337-356 (lines=20) @@ | ||
| 334 | * |
|
| 335 | * @return Arrayy |
|
| 336 | */ |
|
| 337 | public function fetchAllArrayy() |
|
| 338 | { |
|
| 339 | // init |
|
| 340 | $data = array(); |
|
| 341 | ||
| 342 | if ( |
|
| 343 | $this->_result |
|
| 344 | && |
|
| 345 | !$this->is_empty() |
|
| 346 | ) { |
|
| 347 | $this->reset(); |
|
| 348 | ||
| 349 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 350 | while ($row = \mysqli_fetch_assoc($this->_result)) { |
|
| 351 | $data[] = $this->cast($row); |
|
| 352 | } |
|
| 353 | } |
|
| 354 | ||
| 355 | return Arrayy::create($data); |
|
| 356 | } |
|
| 357 | ||
| 358 | /** |
|
| 359 | * Fetch a single column as an 1-dimension array. |
|