Class LoggedQuery
Contains a query string, the params used to executed it, time taken to do it and the number of rows found or affected by its execution.
Property Summary
-
$driver protected
Cake\Database\Driver|null
Driver executing the query
-
$error protected
Exception|null
The exception that was thrown by the execution of this query
-
$numRows protected
int
Number of rows affected or returned by the query execution
-
$params protected
array
Associative array with the params bound to the query string
-
$query protected
string
Query string that was executed
-
$took protected
float
Number of milliseconds this query took to complete
Method Summary
-
__toString() public
Returns the string representation of this logged query
-
getContext() public
Get the logging context data for a query.
-
interpolate() protected
Helper function used to replace query placeholders by the real params used to execute the query
-
jsonSerialize() public
Returns data that will be serialized as JSON
-
setContext() public
Set logging context for this query.
Method Detail
__toString() ¶ public
__toString(): string
Returns the string representation of this logged query
Returns
string
getContext() ¶ public
getContext(): array<string, mixed>
Get the logging context data for a query.
Returns
array<string, mixed>
interpolate() ¶ protected
interpolate(): string
Helper function used to replace query placeholders by the real params used to execute the query
Returns
string
jsonSerialize() ¶ public
jsonSerialize(): array<string, mixed>
Returns data that will be serialized as JSON
Returns
array<string, mixed>
setContext() ¶ public
setContext(array $context): void
Set logging context for this query.
Parameters
-
array
$context Context data.
Returns
void