1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

updated for new Nette Debug Bar

This commit is contained in:
David Grudl
2010-04-01 05:24:13 +02:00
parent 22d41ca3c1
commit 3f6a075251
8 changed files with 1049 additions and 351 deletions

View File

@@ -18,7 +18,7 @@
* @copyright Copyright (c) 2005, 2010 David Grudl
* @package dibi
*/
class DibiException extends Exception implements /*Nette\*/IDebuggable
class DibiException extends Exception implements /*Nette\*/IDebugPanel
{
/** @var string */
private $sql;
@@ -59,23 +59,39 @@ class DibiException extends Exception implements /*Nette\*/IDebuggable
/********************* interface Nette\IDebuggable ****************d*g**/
/********************* interface Nette\IDebugPanel ****************d*g**/
/**
* Returns custom panels.
* @return array
* Returns HTML code for custom tab.
* @return mixed
*/
public function getPanels()
public function getTab()
{
return 'SQL';
}
/**
* Returns HTML code for custom panel.
* @return mixed
*/
public function getPanel()
{
$panels = array();
if ($this->sql !== NULL) {
$panels['SQL'] = array(
'expanded' => TRUE,
'content' => dibi::dump($this->sql, TRUE),
);
}
return $panels;
return dibi::dump($this->sql, TRUE);
}
/**
* Returns panel ID.
* @return string
*/
public function getId()
{
return __CLASS__;
}
}