Cake\Database\Query::__debugInfo PHP Метод

__debugInfo() публичный Метод

Returns an array that can be used to describe the internal state of this object.
public __debugInfo ( ) : array
Результат array
    public function __debugInfo()
    {
        try {
            $restore = set_error_handler(function ($errno, $errstr) {
                throw new RuntimeException($errstr, $errno);
            }, E_ALL);
            $sql = $this->sql();
            $params = $this->valueBinder()->bindings();
        } catch (RuntimeException $e) {
            $sql = 'SQL could not be generated for this query as it is incomplete.';
            $params = [];
        } finally {
            restore_error_handler();
        }
        return ['(help)' => 'This is a Query object, to get the results execute or iterate it.', 'sql' => $sql, 'params' => $params, 'defaultTypes' => $this->defaultTypes(), 'decorators' => count($this->_resultDecorators), 'executed' => $this->_iterator ? true : false];
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function __debugInfo()
 {
     $eagerLoader = $this->eagerLoader();
     return parent::__debugInfo() + ['hydrate' => $this->_hydrate, 'buffered' => $this->_useBufferedResults, 'formatters' => count($this->_formatters), 'mapReducers' => count($this->_mapReduce), 'contain' => $eagerLoader ? $eagerLoader->contain() : [], 'matching' => $eagerLoader ? $eagerLoader->matching() : [], 'extraOptions' => $this->_options, 'repository' => $this->_repository];
 }
All Usage Examples Of Cake\Database\Query::__debugInfo