src/db/DbConnector.php
public function startDebug($listener = null, $type = "")
    {
        if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
            throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
        }
        
        $this->_debugListener = $listener !== null? $listener: function ($sql) {
            echo "$sql\n";
        };
        
        $types = Text::isEmpty($type)? ["exec", "query"]: [$type];
        foreach ($types as $type) {
            $this->_debugger->on($type, $this->_debugListener);
        }
    }
public function startDebug($listener = null, $type = "")
    {
        if (!Text::isEmpty($type) && !in_array($type, ["exec", "query"])) {
            throw new DbException("Invalid filter type. Valid filter types are 'exec' and 'query'");
        }
        
        $this->_debugListener = $listener !== null? $listener: function ($sql) {
            echo "$sql\n";
        };
        
        $types = Text::isEmpty($type)? ["exec", "query"]: [$type];
        foreach ($types as $type) {
            $this->_debugger->on($type, $this->_debugListener);
        }
    }
public function startDebug ( $ listener = null , $ type = "" ) { if ( ! Text :: isEmpty ( $ type ) && ! in_array ( $ type , [ "exec" , "query" ] ) ) { throw new DbException ( "Invalid filter type. Valid filter types are 'exec' and 'query'" ) ; } $ this -> _debugListener = $ listener !== null ? $ listener : function ( $ sql ) { echo "$sql\n" ; } ; $ types = Text :: isEmpty ( $ type ) ? [ "exec" , "query" ] : [ $ type ] ; foreach ( $ types as $ type ) { $ this -> _debugger -> on ( $ type , $ this -> _debugListener ) ; } }
Starts the debugger mechanism.

@param callable $listener Debug listener
@param string   $type     Listener type ('query' or 'exec', not required)

@return void
Starts the debugger mechanism .