QueryInterface
in
Represents a single statement that can be executed against the database.
Statements are platform-specific and can handle binding of binds.
Table of Contents
Methods
- getDuration() : string
- Returns the duration of this query during execution, or null if the query has not been executed yet.
- getErrorCode() : int
- Returns the error code created while executing this statement.
- getErrorMessage() : string
- Returns the error message created while executing this statement.
- getOriginalQuery() : string
- Returns the original SQL that was passed into the system.
- getQuery() : string
- Returns the final, processed query string after binding, etal has been performed.
- hasError() : bool
- Reports whether this statement created an error not.
- isWriteType() : bool
- Determines if the statement is a write-type query or not.
- setDuration() : self
- Records the execution time of the statement using microtime(true) for it's start and end values. If no end value is present, will use the current time to determine total duration.
- setError() : self
- Stores the error description that happened for this query.
- setQuery() : self
- Sets the raw query string to use for this statement.
- swapPrefix() : self
- Swaps out one table prefix for a new one.
Methods
getDuration()
Returns the duration of this query during execution, or null if the query has not been executed yet.
public
getDuration([int $decimals = 6 ]) : string
Parameters
- $decimals : int = 6
-
The accuracy of the returned time.
Return values
stringgetErrorCode()
Returns the error code created while executing this statement.
public
getErrorCode() : int
Return values
intgetErrorMessage()
Returns the error message created while executing this statement.
public
getErrorMessage() : string
Return values
stringgetOriginalQuery()
Returns the original SQL that was passed into the system.
public
getOriginalQuery() : string
Return values
stringgetQuery()
Returns the final, processed query string after binding, etal has been performed.
public
getQuery() : string
Return values
stringhasError()
Reports whether this statement created an error not.
public
hasError() : bool
Return values
boolisWriteType()
Determines if the statement is a write-type query or not.
public
isWriteType() : bool
Return values
boolsetDuration()
Records the execution time of the statement using microtime(true) for it's start and end values. If no end value is present, will use the current time to determine total duration.
public
setDuration(float $start[, float|null $end = null ]) : self
Parameters
- $start : float
- $end : float|null = null
Return values
selfsetError()
Stores the error description that happened for this query.
public
setError(int $code, string $error) : self
Parameters
- $code : int
- $error : string
Return values
selfsetQuery()
Sets the raw query string to use for this statement.
public
setQuery(string $sql[, mixed $binds = null ][, bool $setEscape = true ]) : self
Parameters
- $sql : string
- $binds : mixed = null
- $setEscape : bool = true
Return values
selfswapPrefix()
Swaps out one table prefix for a new one.
public
swapPrefix(string $orig, string $swap) : self
Parameters
- $orig : string
- $swap : string