| @@ 443-459 (lines=17) @@ | ||
| 440 | * |
|
| 441 | * @return array|false <p><strong>false</strong> on error</p> |
|
| 442 | */ |
|
| 443 | public function fetchArray(bool $reset = false) |
|
| 444 | { |
|
| 445 | if ($reset === true) { |
|
| 446 | $this->reset(); |
|
| 447 | } |
|
| 448 | ||
| 449 | $row = \mysqli_fetch_assoc($this->_result); |
|
| 450 | if ($row) { |
|
| 451 | return $this->cast($row); |
|
| 452 | } |
|
| 453 | ||
| 454 | if ($row === null) { |
|
| 455 | return []; |
|
| 456 | } |
|
| 457 | ||
| 458 | return false; |
|
| 459 | } |
|
| 460 | ||
| 461 | /** |
|
| 462 | * Fetch data as a key/value pair array. |
|
| @@ 509-525 (lines=17) @@ | ||
| 506 | * |
|
| 507 | * @return Arrayy|false <p><strong>false</strong> on error</p> |
|
| 508 | */ |
|
| 509 | public function fetchArrayy(bool $reset = false) |
|
| 510 | { |
|
| 511 | if ($reset === true) { |
|
| 512 | $this->reset(); |
|
| 513 | } |
|
| 514 | ||
| 515 | $row = \mysqli_fetch_assoc($this->_result); |
|
| 516 | if ($row) { |
|
| 517 | return Arrayy::create($this->cast($row)); |
|
| 518 | } |
|
| 519 | ||
| 520 | if ($row === null) { |
|
| 521 | return Arrayy::create(); |
|
| 522 | } |
|
| 523 | ||
| 524 | return false; |
|
| 525 | } |
|
| 526 | ||
| 527 | /** |
|
| 528 | * Fetch a single column as string (or as 1-dimension array). |
|