From 94975e7ac81cb5f3c5456fc3589d048870ccf88f Mon Sep 17 00:00:00 2001 From: doctrine Date: Mon, 7 Aug 2006 22:08:41 +0000 Subject: [PATCH] --- Doctrine/DBStatement.php | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Doctrine/DBStatement.php diff --git a/Doctrine/DBStatement.php b/Doctrine/DBStatement.php new file mode 100644 index 000000000..5eca6d189 --- /dev/null +++ b/Doctrine/DBStatement.php @@ -0,0 +1,49 @@ +. + */ +class Doctrine_DBStatement extends PDOStatement { + /** + * @param Doctrine_DB $dbh Doctrine Database Handler + */ + private $dbh; + /** + * @param Doctrine_DB $dbh + */ + private function __construct(Doctrine_DB $dbh) { + $this->dbh = $dbh; + } + /** + * @param array $params + */ + public function execute(array $params = array()) { + + $time = microtime(); + try { + $result = parent::execute($params); + } catch(PDOException $e) { + throw new Doctrine_Exception($this->queryString." ".$e->__toString()); + } + $exectime = (microtime() - $time); + $this->dbh->addExecTime($exectime); + + return $result; + } +} +?>