Skip to content

Commit a2d01c8

Browse files
committed
Add debugTimer callback
1 parent 073b2e3 commit a2d01c8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎NotORM.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ abstract class NotORM_Abstract {
2828
protected $notORM, $table, $primary, $rows, $referenced = array();
2929

3030
protected $debug = false;
31+
protected $debugTimer;
3132
protected $freeze = false;
3233
protected $rowClass = 'NotORM_Row';
3334
protected $jsonAsArray = false;
@@ -75,7 +76,7 @@ function __get($table) {
7576
* @return null
7677
*/
7778
function __set($name, $value) {
78-
if ($name == "debug" || $name == "freeze" || $name == "rowClass" || $name == "jsonAsArray") {
79+
if ($name == "debug" || $name == "debugTimer" || $name == "freeze" || $name == "rowClass" || $name == "jsonAsArray") {
7980
$this->$name = $value;
8081
}
8182
if ($name == "transaction") {

‎NotORM/Result.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ protected function query($query, $parameters) {
159159
}
160160
$return = $this->notORM->connection->prepare($query);
161161
if (!$return || !$return->execute(array_map(array($this, 'formatValue'), $parameters))) {
162-
return false;
162+
$return = false;
163+
}
164+
if ($this->notORM->debugTimer) {
165+
call_user_func($this->notORM->debugTimer);
163166
}
164167
return $return;
165168
}

0 commit comments

Comments
 (0)