PDOStatementHandle deprecated
class PDOStatementHandle (View source)
deprecated
A handle to a PDOStatement, with cached column metadata, and type conversion
Column metadata can't be fetched from a native PDOStatement after multiple calls in some DB backends, so we wrap in this handle object, which also takes care of tidying up content types to keep in line with the SilverStripe 4.4+ type expectations.
Properties
protected static | $type_mapping | Mapping of PDO-reported "native types" to PHP types |
Methods
Fetch a record form the statement with its type data corrected Returns data as an array of maps
Closes the cursor, enabling the statement to be executed again (PDOStatement::closeCursor)
Fetch the SQLSTATE associated with the last operation on the statement handle (PDOStatement::errorCode)
Fetch extended error information associated with the last operation on the statement handle (PDOStatement::errorInfo)
Returns the number of rows affected by the last SQL statement (PDOStatement::rowCount)
Details
__construct(PDOStatement $statement)
Create a new handle.
array
typeCorrectedFetchAll()
Fetch a record form the statement with its type data corrected Returns data as an array of maps
bool
closeCursor()
Closes the cursor, enabling the statement to be executed again (PDOStatement::closeCursor)
string
errorCode()
Fetch the SQLSTATE associated with the last operation on the statement handle (PDOStatement::errorCode)
array
errorInfo()
Fetch extended error information associated with the last operation on the statement handle (PDOStatement::errorInfo)
int
rowCount()
Returns the number of rows affected by the last SQL statement (PDOStatement::rowCount)
bool
execute(array $parameters)
Executes a prepared statement (PDOStatement::execute)
PDOStatement
getPDOStatement()
Return the PDOStatement that this object provides a handle to