projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7df1588
)
CRM_Core_Error - Add debug_query_result() helper
author
Tim Otten
<totten@civicrm.org>
Mon, 10 Nov 2014 21:19:49 +0000
(13:19 -0800)
committer
Tim Otten
<totten@civicrm.org>
Tue, 11 Nov 2014 00:21:17 +0000
(16:21 -0800)
CRM/Core/Error.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/Error.php
b/CRM/Core/Error.php
index e3cb5a4d7bb711185d96135fb9e1ccdb87afc69b..609506f88a83c74ceff6dd20b0c453c3ad3c8e25 100644
(file)
--- a/
CRM/Core/Error.php
+++ b/
CRM/Core/Error.php
@@
-613,6
+613,20
@@
class CRM_Core_Error extends PEAR_ErrorStack {
}
}
+ /**
+ * Execute a query and log the results.
+ *
+ * @param string $query
+ */
+ static function debug_query_result($query) {
+ $dao = CRM_Core_DAO::executeQuery($query);
+ $results = array();
+ while ($dao->fetch()) {
+ $results[] = (array)$dao;
+ }
+ CRM_Core_Error::debug_var('dao result', array('query' => $query, 'results' => $results));
+ }
+
/**
* Obtain a reference to the error log
*