Class

DebugPDOStatement

class DebugPDOStatement extends PDOStatement

PDOStatement that provides some enhanced functionality needed by Propel.

Simply adds the ability to count the number of queries executed and log the queries/method calls.

Methods

string getExecutedQueryString(array $values = array())

boolean execute(string $input_parameters = null)

Executes a prepared 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 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.

Details

at line 68
public string getExecutedQueryString(array $values = array())

Parameters

array $values Parameters which were passed to execute(), if any. Default: bound parameters.

Return Value

string

at line 99
public boolean execute(string $input_parameters = null)

Executes a prepared statement.

Returns a boolean value indicating success. Overridden for query counting and logging.

Parameters

string $input_parameters

Return Value

boolean

at line 122
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.

Parameters

integer $pos Parameter identifier (for determining what to replace in the query).
mixed $value The value to bind to the parameter.
integer $type Explicit data type for the parameter using the PDO::PARAM* constants. Defaults to PDO::PARAMSTR.

Return Value

boolean

at line 151
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.

Parameters

integer $pos Parameter identifier (for determining what to replace in the query).
mixed $value The value to bind to the parameter.
integer $type Explicit data type for the parameter using the PDO::PARAM* constants. Defaults to PDO::PARAMSTR.
integer $length Length of the data type. To indicate that a parameter is an OUT parameter from a stored procedure, you must explicitly set the length.
mixed $driver_options

Return Value

boolean