PreparedQuery
        
        extends BasePreparedQuery
    
    
            
            in package
            
        
    
    
    
Prepared query for Postgre
Tags
Table of Contents
Properties
- $db : Connection
- A reference to the db connection to use.
- $errorCode : int
- The error code, if any.
- $errorString : string
- The error message, if any.
- $parameters : array<string|int, mixed>
- Parameters array used to store the dynamic variables.
- $query : Query
- Holds the prepared query object that is cloned during execute.
- $statement : TStatement|null
- The prepared statement itself.
Methods
- __construct() : mixed
- _execute() : bool
- Takes a new set of data and runs it against the currently prepared query.
- _getResult() : resource|null
- Returns the statement resource for the prepared query or false when preparing failed.
- _prepare() : $this
- Prepares the query against the database, and saves the connection info necessary to execute the query later.
- close() : bool
- Explicitly closes the prepared statement.
- execute() : bool|ResultInterface<TConnection, TResult>
- Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.
- getErrorCode() : int
- Returns the error code created while executing this statement.
- getErrorMessage() : string
- Returns the error message created while executing this statement.
- getQueryString() : string
- Returns the SQL that has been prepared.
- hasError() : bool
- A helper to determine if any error exists.
- prepare() : $this
- Prepares the query against the database, and saves the connection info necessary to execute the query later.
- _close() : bool
- Deallocate prepared statements.
- isBinary() : bool
- Whether the input contain binary data.
- parameterize() : array<string|int, mixed>
- Handle parameters.
Properties
$db
A reference to the db connection to use.
        protected
            Connection
    $db
    
    
    
    
    
    
$errorCode
The error code, if any.
        protected
            int
    $errorCode
    
    
    
    
    
    
$errorString
The error message, if any.
        protected
            string
    $errorString
    
    
    
    
    
    
$parameters
Parameters array used to store the dynamic variables.
        protected
            array<string|int, mixed>
    $parameters
     = []
    
    
    
    
    
$query
Holds the prepared query object that is cloned during execute.
        protected
            Query
    $query
    
    
    
    
    
    
$statement
The prepared statement itself.
        protected
            TStatement|null
    $statement
    
    
    
    
    
    
Methods
__construct()
    public
                    __construct(Connection $db) : mixed
    Parameters
- $db : Connection
_execute()
Takes a new set of data and runs it against the currently prepared query.
    public
                    _execute(array<string|int, mixed> $data) : bool
    Parameters
- $data : array<string|int, mixed>
Return values
bool_getResult()
Returns the statement resource for the prepared query or false when preparing failed.
    public
                    _getResult() : resource|null
    Return values
resource|null_prepare()
Prepares the query against the database, and saves the connection info necessary to execute the query later.
    public
                    _prepare(string $sql[, array<string|int, mixed> $options = [] ]) : $this
    NOTE: This version is based on SQL code. Child classes should override this method.
Parameters
- $sql : string
- $options : array<string|int, mixed> = []
- 
                    Options takes an associative array; 
Tags
Return values
$thisclose()
Explicitly closes the prepared statement.
    public
                    close() : bool
    Tags
Return values
boolexecute()
Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.
    public
                    execute(mixed ...$data) : bool|ResultInterface<TConnection, TResult>
    Parameters
- $data : mixed
Tags
Return values
bool|ResultInterface<TConnection, TResult>getErrorCode()
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
stringgetQueryString()
Returns the SQL that has been prepared.
    public
                    getQueryString() : string
    Return values
stringhasError()
A helper to determine if any error exists.
    public
                    hasError() : bool
    Return values
boolprepare()
Prepares the query against the database, and saves the connection info necessary to execute the query later.
    public
                    prepare(string $sql[, array<string|int, mixed> $options = [] ][, string $queryClass = Query::class ]) : $this
    NOTE: This version is based on SQL code. Child classes should override this method.
Parameters
- $sql : string
- $options : array<string|int, mixed> = []
- $queryClass : string = Query::class
Return values
$this_close()
Deallocate prepared statements.
    protected
                    _close() : bool
    Return values
boolisBinary()
Whether the input contain binary data.
    protected
                    isBinary(string $input) : bool
    Parameters
- $input : string
Return values
boolparameterize()
Handle parameters.
    protected
                    parameterize(string $queryString, array<int, mixed> $options) : array<string|int, mixed>
    Parameters
- $queryString : string
- $options : array<int, mixed>