libasynql  3.2.0
Asynchronous MySQL access library for PocketMine plugins.
SqlError Class Reference
Inheritance diagram for SqlError:

Public Member Functions

 __construct (string $stage, string $errorMessage, string $query=null, array $args=null)
 
 getStage ()
 
 getErrorMessage ()
 
 getQuery ()
 
 getArgs ()
 

Data Fields

const STAGE_CONNECT = "CONNECT"
 
const STAGE_PREPARE = "PREPARE"
 
const STAGE_EXECUTE = "EXECUTION"
 
const STAGE_RESPONSE = "RESPONSE"
 

Protected Member Functions

 flattenTrace ()
 

Detailed Description

Represents a generic error when executing a SQL statement.

Definition at line 40 of file SqlError.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $stage,
string  $errorMessage,
string  $query = null,
array  $args = null 
)

Definition at line 63 of file SqlError.php.

Member Function Documentation

◆ flattenTrace()

flattenTrace ( )
protected

Flattens the trace such that the exception can be serialized

See also
https://gist.github.com/Thinkscape/805ba8b91cdce6bcaf7c Exception flattening solution by Artur Bodera

Definition at line 114 of file SqlError.php.

◆ getArgs()

getArgs ( )

Returns the original arguments passed to the query

Returns
mixed[]|null

Definition at line 105 of file SqlError.php.

◆ getErrorMessage()

getErrorMessage ( )

Returns the error message

Returns
string

Definition at line 87 of file SqlError.php.

◆ getQuery()

getQuery ( )

Returns the original query

Returns
string|null

Definition at line 96 of file SqlError.php.

◆ getStage()

getStage ( )

Returns the stage of query execution at which the error occurred.

Returns
string

Definition at line 78 of file SqlError.php.

Field Documentation

◆ STAGE_CONNECT

const STAGE_CONNECT = "CONNECT"

Returned by getStage(), indicating that an error occurred while connecting to the database

Definition at line 44 of file SqlError.php.

◆ STAGE_EXECUTE

const STAGE_EXECUTE = "EXECUTION"

Returned by getStage(), indicating that an error occurred while the SQL backend is executing the query

Definition at line 52 of file SqlError.php.

◆ STAGE_PREPARE

const STAGE_PREPARE = "PREPARE"

Returned by getStage(), indicating that an error occurred while preparing the query

Definition at line 48 of file SqlError.php.

◆ STAGE_RESPONSE

const STAGE_RESPONSE = "RESPONSE"

Returned by getStage(), indicating that an error occurred while handling the response of the query

Definition at line 56 of file SqlError.php.


The documentation for this class was generated from the following file: