Result class
Framework\Database\Result
Class Result.
Defined in libraries/database/src/Result.php
Properties #
- $result
- -
- $buffered
- -
- $free
- -
- $fetchClass
- -
- $fetchConstructor
- -
$result
protected mysqli_result $result
$buffered
protected bool $buffered
$free
protected bool $free = false
$fetchClass
protected string $fetchClass = 'stdClass'
$fetchConstructor
protected array $fetchConstructor = array (
)
Methods #
- __construct()
- Result constructor.
- __destruct()
- -
- fetch()
- Fetches the current row as object and move the cursor to the next.
- fetchAll()
- Fetches all rows as objects.
- fetchArray()
- Fetches the current row as array and move the cursor to the next.
- fetchArrayAll()
- Fetches all rows as arrays.
- fetchArrayRow()
- Fetches a specific row as array and move the cursor to the next.
- fetchFields()
- Returns an array of objects representing the fields in a result set.
- fetchRow()
- Fetches a specific row as object and move the cursor to the next.
- free()
- Frees the memory associated with a result.
- isBuffered()
- -
- isFree()
- -
- moveCursor()
- Adjusts the result pointer to an arbitrary row in the result.
- numRows()
- Gets the number of rows in the result set.
- setFetchClass()
- -
- checkIsFree()
- -
__construct()
public function __construct(mysqli_result $result, bool $buffered)
Result constructor.
Parameters
- mysqli_result $result
- bool $buffered
__destruct()
public function __destruct()
fetch()
public function fetch(?string $class = NULL, mixed ...$constructor): ?object
Fetches the current row as object and move the cursor to the next.
Parameters
- ?string $class
- mixed $constructor
Returns
?object
fetchAll()
public function fetchAll(?string $class = NULL, mixed ...$constructor): array
Fetches all rows as objects.
Parameters
- ?string $class
- mixed $constructor
Returns
array
fetchArray()
public function fetchArray(): ?array
Fetches the current row as array and move the cursor to the next.
Returns
?array
- float|int|string|null>|null
fetchArrayAll()
public function fetchArrayAll(): array
Fetches all rows as arrays.
Returns
array
fetchArrayRow()
public function fetchArrayRow(int $offset): array
Fetches a specific row as array and move the cursor to the next.
Parameters
- int $offset
Returns
array
- float|int|string|null>
fetchFields()
public function fetchFields(): array
Returns an array of objects representing the fields in a result set.
Returns
array
- an array of objects which contains field definition information
fetchRow()
public function fetchRow(int $offset, ?string $class = NULL, mixed ...$constructor): object
Fetches a specific row as object and move the cursor to the next.
Parameters
- int $offset
- ?string $class
- mixed $constructor
Returns
object
free()
public function free(): void
Frees the memory associated with a result.
Returns
void
isBuffered()
public function isBuffered(): bool
Returns
bool
isFree()
public function isFree(): bool
Returns
bool
moveCursor()
public function moveCursor(int $offset): bool
Adjusts the result pointer to an arbitrary row in the result.
Parameters
- int $offset - The field offset. Must be between zero and the total number of rows minus one
Returns
bool
numRows()
public function numRows(): string|int
Gets the number of rows in the result set.
Returns
string|int
setFetchClass()
public function setFetchClass(string $class, mixed ...$constructor): static
Parameters
- string $class
- mixed $constructor
Returns
static
checkIsFree()
protected function checkIsFree(): void
Returns
void