Properties

$pdo

$pdo : \PDO

Type

\PDO

$executedStatements

$executedStatements : array

Type

array

Methods

__construct()

__construct(\PDO  $pdo) 

Parameters

\PDO $pdo

beginTransaction()

beginTransaction() : boolean

Initiates a transaction

Returns

boolean —

TRUE on success or FALSE on failure.

commit()

commit() : boolean

Commits a transaction

Returns

boolean —

TRUE on success or FALSE on failure.

errorCode()

errorCode() : array

Fetch extended error information associated with the last operation on the database handle

Returns

array —

PDO::errorInfo returns an array of error information

errorInfo()

errorInfo() : array

Fetch extended error information associated with the last operation on the database handle

Returns

array —

PDO::errorInfo returns an array of error information

exec()

exec(string  $statement) : integer|boolean

Execute an SQL statement and return the number of affected rows

Parameters

string $statement

Returns

integer|boolean —

PDO::exec returns the number of rows that were modified or deleted by the SQL statement you issued. If no rows were affected, PDO::exec returns 0. This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information

getAttribute()

getAttribute(integer  $attribute) : mixed

Retrieve a database connection attribute

Parameters

integer $attribute

One of the PDO::ATTR_* constants

Returns

mixed —

A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.

inTransaction()

inTransaction() : boolean

Checks if inside a transaction

Returns

boolean —

TRUE if a transaction is currently active, and FALSE if not.

lastInsertId()

lastInsertId(string  $name = null) : string

Returns the ID of the last inserted row or sequence value

Parameters

string $name

[optional]

Returns

string —

If a sequence name was not specified for the name parameter, PDO::lastInsertId returns a string representing the row ID of the last row that was inserted into the database.

prepare()

prepare(string  $statement, array  $driver_options = array()) : \DebugBar\DataCollector\PDO\TraceablePDOStatement|boolean

Prepares a statement for execution and returns a statement object

Parameters

string $statement

This must be a valid SQL statement template for the target DB server.

array $driver_options

[optional] This array holds one or more key=>value pairs to set attribute values for the PDOStatement object that this method returns.

Returns

\DebugBar\DataCollector\PDO\TraceablePDOStatement|boolean —

If the database server successfully prepares the statement, PDO::prepare returns a PDOStatement object. If the database server cannot successfully prepare the statement, PDO::prepare returns FALSE or emits PDOException (depending on error handling).

query()

query(string  $statement) : \DebugBar\DataCollector\PDO\TraceablePDOStatement|boolean

Executes an SQL statement, returning a result set as a PDOStatement object

Parameters

string $statement

Returns

\DebugBar\DataCollector\PDO\TraceablePDOStatement|boolean —

PDO::query returns a PDOStatement object, or FALSE on failure.

quote()

quote(string  $string, integer  $parameter_type = \PDO::PARAM_STR) : string|boolean

Quotes a string for use in a query.

Parameters

string $string

The string to be quoted.

integer $parameter_type

[optional] Provides a data type hint for drivers that have alternate quoting styles.

Returns

string|boolean —

A quoted string that is theoretically safe to pass into an SQL statement. Returns FALSE if the driver does not support quoting in this way.

rollBack()

rollBack() : boolean

Rolls back a transaction

Returns

boolean —

TRUE on success or FALSE on failure.

setAttribute()

setAttribute(integer  $attribute, mixed  $value) : boolean

Set an attribute

Parameters

integer $attribute
mixed $value

Returns

boolean —

TRUE on success or FALSE on failure.

getAccumulatedStatementsDuration()

getAccumulatedStatementsDuration() : integer

Returns the accumulated execution time of statements

Returns

integer

getMemoryUsage()

getMemoryUsage() : integer

Returns the peak memory usage while performing statements

Returns

integer

getPeakMemoryUsage()

getPeakMemoryUsage() : integer

Returns the peak memory usage while performing statements

Returns

integer

getExecutedStatements()

getExecutedStatements() : array

Returns the list of executed statements as TracedStatement objects

Returns

array

getFailedExecutedStatements()

getFailedExecutedStatements() : array

Returns the list of failed statements

Returns

array

__get()

__get(  $name) : mixed

Parameters

$name

Returns

mixed

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__call()

__call(  $name,   $args) : mixed

Parameters

$name
$args

Returns

mixed

profileCall()

profileCall(string  $method, string  $sql, array  $args) : mixed

Profiles a call to a PDO method

Parameters

string $method
string $sql
array $args

Returns

mixed —

The result of the call