PDOQuery
class PDOQuery extends SS_Query
A result-set from a PDO database.
Methods
Return an array containing all the values from a specific column. If no column is set, then the first will be returned
Return an array containing all values in the leftmost column, where the keys are the same as the values.
Iterator function implementation. Rewind the iterator to the first item and return it.
Iterator function implementation. Return the current item of the iterator.
Iterator function implementation. Return the first item of this iterator.
Iterator function implementation. Return the row number of the current item.
Iterator function implementation. Return the next record in the iterator.
Iterator function implementation. Check if the iterator is pointing to a valid item.
Return the next record in the query result.
Return the total number of items in the query result.
Go to a specific row number in the query result and return the record.
Hook the result-set given into a Query class, suitable for use by SilverStripe.
Details
in SS_Query at line 45
array
column(string $column = null)
Return an array containing all the values from a specific column. If no column is set, then the first will be returned
in SS_Query at line 65
array
keyedColumn()
Return an array containing all values in the leftmost column, where the keys are the same as the values.
in SS_Query at line 79
array
map()
Return a map from the first column to the second column.
in SS_Query at line 94
array
record()
Returns the next record in the iterator.
in SS_Query at line 103
string
value()
Returns the first column of the first record.
in SS_Query at line 113
string
table()
Return an HTML table containing the full result-set
in SS_Query at line 146
array
rewind()
Iterator function implementation. Rewind the iterator to the first item and return it.
Makes use of {@link seek()} and {@link numRecords()}, takes care of the plumbing.
in SS_Query at line 159
array
current()
Iterator function implementation. Return the current item of the iterator.
in SS_Query at line 172
array
first()
Iterator function implementation. Return the first item of this iterator.
in SS_Query at line 182
int
key()
Iterator function implementation. Return the row number of the current item.
in SS_Query at line 192
array
next()
Iterator function implementation. Return the next record in the iterator.
Makes use of {@link nextRecord()}, takes care of the plumbing.
in SS_Query at line 204
bool
valid()
Iterator function implementation. Check if the iterator is pointing to a valid item.
at line 39
array
nextRecord()
Return the next record in the query result.
at line 35
int
numRecords()
Return the total number of items in the query result.
at line 30
array
seek($row)
Go to a specific row number in the query result and return the record.
at line 21
__construct(PDOStatement $statement)
Hook the result-set given into a Query class, suitable for use by SilverStripe.