Result
extends BaseResult
in package
Result for SQLite3
Tags
Table of Contents
Properties
- $connID : TConnection
- $currentRow : int
- Current row index
- $customResultObject : array<class-string, array<int, object>>
- $resultArray : array<int, array<string|int, mixed>>
- $resultID : false|TResult
- $resultObject : array<int, object>
- $rowData : array<string, mixed>|null
- $numRows : int|null
- The number of records in the query result
Methods
- __construct() : mixed
- dataSeek() : bool
- Moves the internal pointer to the desired offset. This is called internally before fetching results to make sure the result set starts at zero.
- freeResult() : void
- Frees the current result.
- getCustomResultObject() : array<int, object>
- Returns the results as an array of custom objects.
- getCustomRowObject() : T|null
- Returns a row as a custom class instance.
- getFieldCount() : int
- Gets the number of fields in the result set.
- getFieldData() : array<int, stdClass>
- Generates an array of objects representing field meta-data.
- getFieldNames() : array<int, string>
- Generates an array of column names in the result set.
- getFirstRow() : |null : \CodeIgniter\Database\T|null))">T|null))
- Returns the "first" row of the current results.
- getLastRow() : |null : \CodeIgniter\Database\T|null))">T|null))
- Returns the "last" row of the current results.
- getNextRow() : |null : \CodeIgniter\Database\T|null))">T|null))
- Returns the "next" row of the current results.
- getNumRows() : int
- Number of rows in the result set; checks for previous count, falls back on counting resultArray or resultObject, finally fetching resultArray if nothing was previously fetched
- getPreviousRow() : |null : \CodeIgniter\Database\T|null))">T|null))
- Returns the "previous" row of the current results.
- getResult() : > : ($type is "object" ? list<\stdClass> : list
- Retrieve the results of the query. Typically an array of individual data rows, which can be either an 'array', an 'object', or a custom class name.
- getResultArray() : array<int, array<string, mixed>>
- Returns the results as an array of arrays.
- getResultObject() : array<int, stdClass>
- Returns the results as an array of objects.
- getRow() : |null : \CodeIgniter\Database\T|null)))">T|null)))
- Wrapper object to return a row as either an array, an object, or a custom class.
- getRowArray() : array<string, mixed>|null
- Returns a single row from the results as an array.
- getRowObject() : object|stdClass|null
- Returns a single row from the results as an object.
- getUnbufferedRow() : array<string, mixed>|object|null
- Returns an unbuffered row and move the pointer to the next row.
- setRow() : void
- Assigns an item into a particular column slot.
- fetchAssoc() : array<string, mixed>|false
- Returns the result set as an array.
- fetchObject() : false|object
- Returns the result set as an object.
Properties
$connID
public
TConnection
$connID
$currentRow
Current row index
public
int
$currentRow
= 0
$customResultObject
public
array<class-string, array<int, object>>
$customResultObject
= []
$resultArray
public
array<int, array<string|int, mixed>>
$resultArray
= []
$resultID
public
false|TResult
$resultID
$resultObject
public
array<int, object>
$resultObject
= []
$rowData
public
array<string, mixed>|null
$rowData
$numRows
The number of records in the query result
protected
int|null
$numRows
Methods
__construct()
public
__construct(TConnection &$connID, TResult &$resultID) : mixed
Parameters
- $connID : TConnection
- $resultID : TResult
dataSeek()
Moves the internal pointer to the desired offset. This is called internally before fetching results to make sure the result set starts at zero.
public
dataSeek([int $n = 0 ]) : bool
Parameters
- $n : int = 0
Tags
Return values
boolfreeResult()
Frees the current result.
public
freeResult() : void
getCustomResultObject()
Returns the results as an array of custom objects.
public
getCustomResultObject(string $className) : array<int, object>
Parameters
- $className : string
-
The name of the class to use.
Return values
array<int, object>getCustomRowObject()
Returns a row as a custom class instance.
public
getCustomRowObject(int $n, string $className) : T|null
If the row doesn't exist, returns null.
Parameters
- $n : int
-
The index of the results to return.
- $className : string
Return values
T|nullgetFieldCount()
Gets the number of fields in the result set.
public
getFieldCount() : int
Return values
intgetFieldData()
Generates an array of objects representing field meta-data.
public
getFieldData() : array<int, stdClass>
Return values
array<int, stdClass>getFieldNames()
Generates an array of column names in the result set.
public
getFieldNames() : array<int, string>
Return values
array<int, string>getFirstRow()
Returns the "first" row of the current results.
public
getFirstRow([string $type = 'object' ]) : |null : \CodeIgniter\Database\T|null))">T|null))
Parameters
- $type : string = 'object'
-
The type of result object. 'array', 'object' or class name.
Return values
|null : \CodeIgniter\Database\T|null))">T|null))getLastRow()
Returns the "last" row of the current results.
public
getLastRow([string $type = 'object' ]) : |null : \CodeIgniter\Database\T|null))">T|null))
Parameters
- $type : string = 'object'
-
The type of result object. 'array', 'object' or class name.
Return values
|null : \CodeIgniter\Database\T|null))">T|null))getNextRow()
Returns the "next" row of the current results.
public
getNextRow([string $type = 'object' ]) : |null : \CodeIgniter\Database\T|null))">T|null))
Parameters
- $type : string = 'object'
-
The type of result object. 'array', 'object' or class name.
Return values
|null : \CodeIgniter\Database\T|null))">T|null))getNumRows()
Number of rows in the result set; checks for previous count, falls back on counting resultArray or resultObject, finally fetching resultArray if nothing was previously fetched
public
getNumRows() : int
Return values
intgetPreviousRow()
Returns the "previous" row of the current results.
public
getPreviousRow([string $type = 'object' ]) : |null : \CodeIgniter\Database\T|null))">T|null))
Parameters
- $type : string = 'object'
-
The type of result object. 'array', 'object' or class name.
Return values
|null : \CodeIgniter\Database\T|null))">T|null))getResult()
Retrieve the results of the query. Typically an array of individual data rows, which can be either an 'array', an 'object', or a custom class name.
public
getResult([string $type = 'object' ]) : > : ($type is "object" ? list<\stdClass> : list))">stdClass> : list))
Parameters
- $type : string = 'object'
-
The row type. Either 'array', 'object', or a class name to use
Return values
> : ($type is "object" ? list<\stdClass> : listgetResultArray()
Returns the results as an array of arrays.
public
getResultArray() : array<int, array<string, mixed>>
If no results, an empty array is returned.
Return values
array<int, array<string, mixed>>getResultObject()
Returns the results as an array of objects.
public
getResultObject() : array<int, stdClass>
If no results, an empty array is returned.
Return values
array<int, stdClass>getRow()
Wrapper object to return a row as either an array, an object, or a custom class.
public
getRow([mixed $n = 0 ][, string $type = 'object' ]) : |null : \CodeIgniter\Database\T|null)))">T|null)))
If the row doesn't exist, returns null.
Parameters
- $n : mixed = 0
-
The index of the results to return, or column name.
- $type : string = 'object'
-
The type of result object. 'array', 'object' or class name.
Return values
|null : \CodeIgniter\Database\T|null)))">T|null)))getRowArray()
Returns a single row from the results as an array.
public
getRowArray([int $n = 0 ]) : array<string, mixed>|null
If row doesn't exist, returns null.
Parameters
- $n : int = 0
Return values
array<string, mixed>|nullgetRowObject()
Returns a single row from the results as an object.
public
getRowObject([int $n = 0 ]) : object|stdClass|null
If row doesn't exist, returns null.
Parameters
- $n : int = 0
Return values
object|stdClass|nullgetUnbufferedRow()
Returns an unbuffered row and move the pointer to the next row.
public
getUnbufferedRow([string $type = 'object' ]) : array<string, mixed>|object|null
Parameters
- $type : string = 'object'
Return values
array<string, mixed>|object|nullsetRow()
Assigns an item into a particular column slot.
public
setRow(mixed $key[, mixed $value = null ]) : void
Parameters
- $key : mixed
- $value : mixed = null
fetchAssoc()
Returns the result set as an array.
protected
fetchAssoc() : array<string, mixed>|false
Return values
array<string, mixed>|falsefetchObject()
Returns the result set as an object.
protected
fetchObject([string $className = stdClass::class ]) : false|object
Parameters
- $className : string = stdClass::class