Merge pull request #2393 from yashodha/HR-252
[civicrm-core.git] / CRM / Report / BAO / Hook.php
index 6c2cee9f6c87a53801024041a098bf6a6b9e3a7b..2321c23b7ba33dc06f547a74a2aae7d54fb29227 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -72,9 +72,21 @@ class CRM_Report_BAO_Hook {
     return $this->_queryObjects;
   }
 
-  public function alterLogTables(&$logTables) {
+  public function alterLogTables(&$reportObj, &$logTables) {
     foreach (self::getSearchQueryObjects() as $obj) {
-      $obj->alterLogTables($logTables);
+      $obj->alterLogTables($reportObj, $logTables);
     }
   }
-}
\ No newline at end of file
+
+  public function logDiffClause(&$reportObj, $table) {
+    $contactIdClause = $join = '';
+    foreach (self::getSearchQueryObjects() as $obj) {
+      list($cidClause, $joinClause) = $obj->logDiffClause($reportObj, $table);
+      if ($joinClause) 
+        $join .= $joinClause;
+      if ($cidClause) 
+        $contactIdClause .= $cidClause;
+    }
+    return array($contactIdClause, $join);
+  }
+}