PHP Class Crud\Listener\ApiQueryLogListener

Very much like the DebugKit version, the SQL log will only be appended if the following conditions is true: 1) The request must be 'api' (.json/.xml) 2) The debug level must be 2 or above Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Inheritance: extends BaseListener
Afficher le fichier Open project: friendsofcake/crud

Méthodes publiques

Méthode Description
beforeRender ( Cake\Event\Event $event ) : void Appends the query log to the JSON or XML output
implementedEvents ( ) : array Returns a list of all events that will fire in the controller during its lifecycle.
setupLogging ( Cake\Event\Event $event ) : void Setup logging for all connections

Méthodes protégées

Méthode Description
_getQueryLogs ( ) : array Get the query logs for all sources
_getSource ( string $source ) : Cake\Datasource\ConnectionInterface Get a specific data source
_getSources ( ) : array Get a list of sources defined in database.php

Method Details

_getQueryLogs() protected méthode

Get the query logs for all sources
protected _getQueryLogs ( ) : array
Résultat array

_getSource() protected méthode

Get a specific data source
protected _getSource ( string $source ) : Cake\Datasource\ConnectionInterface
$source string Datasource name
Résultat Cake\Datasource\ConnectionInterface

_getSources() protected méthode

Get a list of sources defined in database.php
protected _getSources ( ) : array
Résultat array

beforeRender() public méthode

Appends the query log to the JSON or XML output
public beforeRender ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
Résultat void

implementedEvents() public méthode

You can override this function to add you own listener callbacks We attach at priority 10 so normal bound events can run before us
public implementedEvents ( ) : array
Résultat array

setupLogging() public méthode

Setup logging for all connections
public setupLogging ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
Résultat void