PdoReader
class PdoReader extends AbstractReader (View source)
Class PdoReader
Methods
Method to get the first field of the first row of the result set from the database query.
Method to get an array of values from the $offset field in each row of the result set from the database query.
Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.
Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.
Method to get the first row of the result set from the database query as an associative array of ['field' => 'value'].
Method to get an array of the result set rows from the database query where each row is an associative array of ['fieldname' => 'rowvalue']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.
Method to get the first row of the result set from the database query as an object.
Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.
count
Method to fetch a row from the result set cursor as an array.
Method to fetch a row from the result set cursor as an associative array.
Method to fetch a row from the result set cursor as an object.
Get the number of affected rows for the previous executed SQL statement.
Method to get the auto-incremented value from the last INSERT statement.
Method to get property Cursor
fetch
fetchAll
Details
in AbstractReader at line line 41
__construct(AbstractDatabaseDriver $db)
Constructor.
in AbstractReader at line line 53
$this
setQuery(Query $query)
setQuery
in AbstractReader at line line 65
AbstractReader
execute()
execute
in AbstractReader at line line 84
DataIterator
getIterator()
getIterator
in AbstractReader at line line 99
mixed
loadResult()
Method to get the first field of the first row of the result set from the database query.
in AbstractReader at line line 126
mixed
loadColumn(integer $offset)
Method to get an array of values from the $offset field in each row of the result set from the database query.
in AbstractReader at line line 151
mixed
loadArray()
Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.
in AbstractReader at line line 176
mixed
loadArrayList(string $key = null)
Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.
NOTE: Choosing to key the result array by a non-unique field can result in unwanted behavior and should be avoided.
in AbstractReader at line line 208
mixed
loadAssoc()
Method to get the first row of the result set from the database query as an associative array of ['field' => 'value'].
in AbstractReader at line line 231
mixed
loadAssocList(string $key = null)
Method to get an array of the result set rows from the database query where each row is an associative array of ['fieldname' => 'rowvalue']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.
in AbstractReader at line line 264
mixed
loadObject(string $class = 'stdClass')
Method to get the first row of the result set from the database query as an object.
in AbstractReader at line line 292
mixed
loadObjectList(string $key = null, string $class = 'stdClass')
Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.
NOTE: Choosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.
at line line 126
mixed
count(resource $cursor = null)
count
at line line 35
mixed
fetchArray()
Method to fetch a row from the result set cursor as an array.
at line line 47
mixed
fetchAssoc()
Method to fetch a row from the result set cursor as an associative array.
at line line 61
mixed
fetchObject(string $class = 'stdClass')
Method to fetch a row from the result set cursor as an object.
at line line 141
int
countAffected(resource $cursor = null)
Get the number of affected rows for the previous executed SQL statement.
Only applicable for DELETE, INSERT, or UPDATE statements.
at line line 163
string
insertId()
Method to get the auto-incremented value from the last INSERT statement.
in AbstractReader at line line 381
$this
freeResult()
freeResult
in AbstractReader at line line 393
AbstractDatabaseDriver
getDriver()
Method to get property Db
in AbstractReader at line line 405
AbstractReader
setDriver(AbstractDatabaseDriver $db)
Method to set property db
at line line 174
resource
getCursor()
Method to get property Cursor
in AbstractReader at line line 429
AbstractReader
setCursor(resource $cursor)
Method to set property cursor
at line line 84
bool|mixed
fetch(int $type = \PDO::FETCH_ASSOC, int $ori = null, int $offset)
fetch
at line line 107
array|bool
fetchAll(int $type = \PDO::FETCH_ASSOC, array $args = null, array $ctorArgs = null)
fetchAll