class DatabaseQuery

A MySQL query that will be profiled on a development environment

Constants

MICROSECONDS_IN_SECOND

Methods

__construct(string $query, array|null $params)

Debug a database query

void
finish(mixed $return)

Mark a query as finished

string
getQuery(bool $highlight = false)

Get the value the MySQL query

string
getQueryType()

Get the first keyword of the query (e.g. SELECT)

array|null
getParams()

Get the parameters of the query

array|null
getParameters()

Get the parameters of the query

float
getDuration()

Get the duration of the query in microseconds

mixed
getResults()

Get the query results

array
getQueryParts(bool $highlight = false)

Get the query string parts

string
getResolvedQuery(bool $highlight = false)

Get the resolved query strings (where all ?s are replaced with the actual parameter values)

Details

at line line 75
__construct(string $query, array|null $params)

Debug a database query

Parameters

string $query The MySQL query
array|null $params The query parameters

at line line 96
void finish(mixed $return)

Mark a query as finished

Parameters

mixed $return The returned values of the query

Return Value

void

at line line 124
string getQuery(bool $highlight = false)

Get the value the MySQL query

Parameters

bool $highlight Whether HTML should be used to highlight to the query

Return Value

string

at line line 138
string getQueryType()

Get the first keyword of the query (e.g. SELECT)

Return Value

string

at line line 150
array|null getParams()

Get the parameters of the query

Alias for DatabaseQuery::getParams()

Return Value

array|null

at line line 160
array|null getParameters()

Get the parameters of the query

Return Value

array|null

at line line 170
float getDuration()

Get the duration of the query in microseconds

Return Value

float

at line line 180
mixed getResults()

Get the query results

Return Value

mixed

at line line 191
array getQueryParts(bool $highlight = false)

Get the query string parts

Parameters

bool $highlight Whether HTML should be used to highlight to the query

Return Value

array

at line line 203
string getResolvedQuery(bool $highlight = false)

Get the resolved query strings (where all ?s are replaced with the actual parameter values)

Parameters

bool $highlight Whether HTML should be used to highlight to the query

Return Value

string