class StatementWrapper implements StatementInterface, IteratorAggregate
Wraps a Statement class, providing logging.
Methods
__construct(string $sql, ConnectionWrapper $connection, array $options = array())
Creates a Statement instance |
||
boolean |
bindParam(integer $pos, mixed $value, integer $type = \PDO::PARAM_STR, integer $length, mixed $driver_options = null)
Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement that was use to prepare the statement. |
|
boolean |
bindValue(integer $pos, mixed $value, integer $type = \PDO::PARAM_STR)
Binds a value to a corresponding named or question mark placeholder in the SQL statement that was use to prepare the statement. |
|
boolean |
closeCursor()
Closes the cursor, enabling the statement to be executed again. |
|
integer |
columnCount()
Returns the number of columns in the result set. |
|
boolean |
execute(string $parameters = null)
Executes a prepared statement. |
|
string | getExecutedQueryString() | |
mixed |
fetch(integer $fetchStyle = 4)
Fetches the next row from a result set. |
|
array |
fetchAll(integer $fetchStyle = 4)
Returns an array containing all of the result set rows. |
|
string |
fetchColumn(integer $columnIndex)
Returns a single column from the next row of a result set. |
|
integer |
rowCount()
Returns the number of rows affected by the last SQL statement |
|
Traversable |
getIterator()
Return the internal statement, which is traversable |
|
__call($method, $args) |
Details
at line 61
public
__construct(string $sql, ConnectionWrapper $connection, array $options = array())
Creates a Statement instance
at line 81
public boolean
bindParam(integer $pos, mixed $value, integer $type = \PDO::PARAM_STR, integer $length, mixed $driver_options = null)
Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement that was use to prepare the statement.
Unlike PDOStatement::bindValue(), the variable is bound
as a reference and will only be evaluated at the time that PDOStatement::execute() is called.
Returns a boolean value indicating success.
at line 105
public boolean
bindValue(integer $pos, mixed $value, integer $type = \PDO::PARAM_STR)
Binds a value to a corresponding named or question mark placeholder in the SQL statement that was use to prepare the statement.
Returns a boolean value indicating success.
at line 133
public boolean
closeCursor()
Closes the cursor, enabling the statement to be executed again.
closeCursor() frees up the connection to the server so that other SQL
statements may be issued, but leaves the statement in a state that enables
it to be executed again.
This method is useful for database drivers that do not support executing
a PDOStatement object when a previously executed PDOStatement object still
has unfetched rows. If your database driver suffers from this limitation,
the problem may manifest itself in an out-of-sequence error.
at line 155
public integer
columnCount()
Returns the number of columns in the result set.
Use columnCount() to return the number of columns in the result set
represented by the Statement object.
If the Statement object was returned from PDO::query(), the column count
is immediately available.
If the Statement object was returned from PDO::prepare(), an accurate
column count will not be available until you invoke Statement::execute().
Returns the number of columns in the result set
at line 169
public boolean
execute(string $parameters = null)
Executes a prepared statement.
Returns a boolean value indicating success.
Overridden for query counting and logging.
at line 185
public string
getExecutedQueryString()
at line 210
public mixed
fetch(integer $fetchStyle = 4)
Fetches the next row from a result set.
Fetches a row from a result set associated with a Statement object.
The fetch_style parameter determines how the Connection returns the row.
at line 222
public array
fetchAll(integer $fetchStyle = 4)
Returns an array containing all of the result set rows.
at line 236
public string
fetchColumn(integer $columnIndex)
Returns a single column from the next row of a result set.
at line 254
public integer
rowCount()
Returns the number of rows affected by the last SQL statement
rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
executed by the corresponding Statement object.
If the last SQL statement executed by the associated Statement object was a SELECT statement,
some databases may return the number of rows returned by that statement. However,
this behaviour is not guaranteed for all databases and should not be
relied on for portable applications.
at line 264
public Traversable
getIterator()
Return the internal statement, which is traversable