W3cubDocs

/CakePHP 4.1

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.

Namespace: Cake\Database\Log

Properties summary

  • $error public
    \Exception|null

    The exception that was thrown by the execution of this query

  • $numRows public
    int

    Number of rows affected or returned by the query execution

  • $params public
    array

    Associative array with the params bound to the query string

  • $query public
    string

    Query string that was executed

  • $took public
    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

Method Detail

__toString() public

__toString()

Returns the string representation of this logged query

Returns

string

getContext() public

getContext()

Get the logging context data for a query.

Returns

array

interpolate() protected

interpolate()

Helper function used to replace query placeholders by the real params used to execute the query

Returns

string

jsonSerialize() public

jsonSerialize()

Returns data that will be serialized as JSON

Returns

array

Property Detail

$error public

The exception that was thrown by the execution of this query

Type

\Exception|null

$numRows public

Number of rows affected or returned by the query execution

Type

int

$params public

Associative array with the params bound to the query string

Type

array

$query public

Query string that was executed

Type

string

$took public

Number of milliseconds this query took to complete

Type

float

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Database.Log.LoggedQuery.html