summaryrefslogtreecommitdiff
path: root/framework/Data/TDbCommand.php
diff options
context:
space:
mode:
authorwei <>2007-02-19 02:23:19 +0000
committerwei <>2007-02-19 02:23:19 +0000
commit826a0ceb950872bb311addd24c1a8da76a1cccc6 (patch)
treeda833758be6a683a4cada41c417a522698705758 /framework/Data/TDbCommand.php
parentdb1a9b1af8aee6d5967e96d3f8928d1576c45daf (diff)
Add trace to active records and TDbCommand
Diffstat (limited to 'framework/Data/TDbCommand.php')
-rw-r--r--framework/Data/TDbCommand.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php
index 9cf5b0a0..102bdf34 100644
--- a/framework/Data/TDbCommand.php
+++ b/framework/Data/TDbCommand.php
@@ -180,6 +180,7 @@ class TDbCommand extends TComponent
{
try
{
+ Prado::trace('Execute Command: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
{
$this->_statement->execute();
@@ -197,7 +198,7 @@ class TDbCommand extends TComponent
/**
* @return String prepared SQL text for debugging purposes.
*/
- protected function getDebugStatementText()
+ public function getDebugStatementText()
{
if(Prado::getApplication()->getMode() === TApplicationMode::Debug)
return $this->_statement instanceof PDOStatement ?
@@ -215,6 +216,7 @@ class TDbCommand extends TComponent
{
try
{
+ Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else
@@ -239,6 +241,7 @@ class TDbCommand extends TComponent
{
try
{
+ Prado::trace('Query Row: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else
@@ -264,6 +267,7 @@ class TDbCommand extends TComponent
{
try
{
+ Prado::trace('Query Scalar: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else