DbResult
in
Represents a database result set.
Table of Contents
Methods
- getBoolean() : bool
- Gets the value from the target index cast as a boolean value.
- getBooleanOrNull() : bool|null
- Checks if the field is null, then gets the value from the target index cast as a boolean value.
- getFloat() : float
- Gets the value from the target index cast as a floating point number.
- getFloatOrNull() : float
- Checks if the field is null, then gets the value from the target index cast as a floating point number.
- getInteger() : int
- Gets the value from the target index cast as an integer.
- getIntegerOrNull() : int
- Checks if the field is null, then gets the value from the target index cast as an integer.
- getIterator() : DbResultIterator
- Creates an iterator for this result.
- getString() : string
- Gets the value from the target index cast as a native string.
- getStringOrNull() : string|null
- Checks if the field is null, then gets the value from the target index cast as a native string.
- getValue() : mixed
- Gets the value from the target index without any additional casting.
- isNull() : bool
- Checks if a given index has a NULL value.
- next() : bool
- Fetches the next result set.
Methods
getBoolean()
Gets the value from the target index cast as a boolean value.
public
getBoolean(int|string $index) : bool
Parameters
- $index : int|string
-
Target index.
Return values
bool —Returns the value cast to a boolean value.
getBooleanOrNull()
Checks if the field is null, then gets the value from the target index cast as a boolean value.
public
getBooleanOrNull(int|string $index) : bool|null
Parameters
- $index : int|string
-
Target index.
Return values
bool|null —Returns the value cast to a boolean value or null.
getFloat()
Gets the value from the target index cast as a floating point number.
public
getFloat(int|string $index) : float
Parameters
- $index : int|string
-
Target index.
Return values
float —Returns the value cast to a floating point number.
getFloatOrNull()
Checks if the field is null, then gets the value from the target index cast as a floating point number.
public
getFloatOrNull(int|string $index) : float
Parameters
- $index : int|string
-
Target index.
Return values
float —Returns the value cast to a floating point number or null.
getInteger()
Gets the value from the target index cast as an integer.
public
getInteger(int|string $index) : int
Parameters
- $index : int|string
-
Target index.
Return values
int —Returns the value cast to an integer.
getIntegerOrNull()
Checks if the field is null, then gets the value from the target index cast as an integer.
public
getIntegerOrNull(int|string $index) : int
Parameters
- $index : int|string
-
Target index.
Return values
int —Returns the value cast to an integer or null.
getIterator()
Creates an iterator for this result.
public
getIterator(callable(DbResult): object $construct) : DbResultIterator
Parameters
- $construct : callable(DbResult): object
-
Result info constructor.
Return values
DbResultIterator —Result iterator.
getString()
Gets the value from the target index cast as a native string.
public
getString(int|string $index) : string
Parameters
- $index : int|string
-
Target index.
Return values
string —Returns a string of the value.
getStringOrNull()
Checks if the field is null, then gets the value from the target index cast as a native string.
public
getStringOrNull(int|string $index) : string|null
Parameters
- $index : int|string
-
Target index.
Return values
string|null —Returns a string of the value or null.
getValue()
Gets the value from the target index without any additional casting.
public
getValue(int|string $index) : mixed
Parameters
- $index : int|string
-
Target index.
Return values
mixed —Target value.
isNull()
Checks if a given index has a NULL value.
public
isNull(int|string $index) : bool
Parameters
- $index : int|string
-
Target index.
Return values
bool —true if the value is null, false if not.
next()
Fetches the next result set.
public
next() : bool
Return values
bool —true if the result set was loaded, false if no more results are available.