From d090b80b079e29e374474ae7ed4c86375ffc5588 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 10 Nov 2014 13:19:49 -0800 Subject: [PATCH] CRM_Core_Error - Add debug_query_result() helper --- CRM/Core/Error.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index e3cb5a4d7b..609506f88a 100644 --- 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 * -- 2.25.1