summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorSam <[email protected]>2013-06-10 07:53:56 +0200
committerSimon Holywell <[email protected]>2013-08-28 16:13:37 +0100
commitf424b5084a01cccfb23867e6e3274f59318a8290 (patch)
tree342ec635370287d0b2e87e92b7c78bb3c922315e /idiorm.php
parent7f59e955249fdea88302ac2d6b5d5034e98496ec (diff)
logger callback
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/idiorm.php b/idiorm.php
index 9fc1983..d643319 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -65,6 +65,7 @@
'driver_options' => null,
'identifier_quote_character' => null, // if this is null, will be autodetected
'logging' => false,
+ 'logger' => null,
'caching' => false,
'return_result_sets' => false,
);
@@ -407,6 +408,13 @@
self::$_last_query = $bound_query;
self::$_query_log[$connection_name][] = $bound_query;
+
+
+ if(is_callable(self::$_config[$connection_name]['logger'])){
+ $logger = $self::$_config[$connection_name]['logger'];
+ $logger($bound_query);
+ }
+
return true;
}