CRM-17335 toward eliminating use of leaky static
authoreileen <emcnaughton@wikimedia.org>
Tue, 10 Nov 2015 21:22:41 +0000 (13:22 -0800)
committereileen <emcnaughton@wikimedia.org>
Tue, 10 Nov 2015 21:26:46 +0000 (13:26 -0800)
Change-Id: I9181add19192993a2bfb994cd1b03397e77ba4d3

CRM/Contribute/BAO/Contribution.php
CRM/Dedupe/Merger.php
CRM/Member/Form/Task/SearchTaskHookSample.php
CRM/PCP/BAO/PCP.php
CRM/Pledge/BAO/Pledge.php
CRM/Pledge/Form/Task/SearchTaskHookSample.php
tools/extensions/org.civicrm.search.activity/ActivitySearch.php
tools/scripts/solr/createSolrXML.php

index d6e68f17e211e402238e4b7cd2faaff18c84ca6f..7d2bc71b3fbbf21a525dff1e3455e6efd1f6f01f 100644 (file)
@@ -848,7 +848,7 @@ LEFT JOIN  civicrm_line_item i ON ( i.contribution_id = c.id AND i.entity_table
   GROUP BY  currency
 ";
 
-    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query);
     $amount = array();
     $count = 0;
     while ($dao->fetch()) {
@@ -1178,7 +1178,7 @@ FROM   civicrm_contribution, civicrm_contact
 WHERE  civicrm_contribution.contact_id = civicrm_contact.id
   AND  civicrm_contribution.id = {$id}
 ";
-    return CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray);
+    return CRM_Core_DAO::singleValueQuery($query);
   }
 
   /**
index a138102bd387ca29ed0b4603e7b9e9bf48ed952d..2b27fa6ae528aaeef5dd452da4ee52ab5965fee6 100644 (file)
@@ -1550,7 +1550,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       // get the contact_id -> file_id mapping
       $fileIds = array();
       $sql = "SELECT entity_id, {$columnName} AS file_id FROM {$tableName} WHERE entity_id IN ({$mainId}, {$otherId})";
-      $dao = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+      $dao = CRM_Core_DAO::executeQuery($sql);
       while ($dao->fetch()) {
         $fileIds[$dao->entity_id] = $dao->file_id;
       }
@@ -1569,7 +1569,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       else {
         $sql = "INSERT INTO {$tableName} ( entity_id, {$columnName} ) VALUES ( {$mainId}, {$fileIds[$otherId]} )";
       }
-      CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+      CRM_Core_DAO::executeQuery($sql);
 
       if (CRM_Core_DAO::singleValueQuery("
         SELECT id
@@ -1586,7 +1586,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
           INSERT INTO civicrm_entity_file ( entity_table, entity_id, file_id )
           VALUES ( '{$tableName}', {$mainId}, {$fileIds[$otherId]} )";
       }
-      CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+      CRM_Core_DAO::executeQuery($sql);
     }
 
     // move view only custom fields CRM-5362
index 65f42f6e4cf03bde9166b9529fe5a6784ea43ac4..a2b3d53ae0ff5bb9d5c63b7ce13b910808399b70 100644 (file)
@@ -59,7 +59,7 @@ FROM       civicrm_membership mem
 INNER JOIN civicrm_contact ct ON ( mem.contact_id = ct.id )
 WHERE      mem.id IN ( $memberIDs )";
 
-    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
       $rows[] = array(
         'display_name' => $dao->display_name,
index 638994babebbfcec6a36ab0a3c81b348e03151fc..1f789f8fe7fa279aec8fcedd6e13b73d91d1e5a8 100644 (file)
@@ -104,7 +104,7 @@ FROM   civicrm_pcp, civicrm_contact
 WHERE  civicrm_pcp.contact_id = civicrm_contact.id
   AND  civicrm_pcp.id = {$id}
 ";
-    return CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray);
+    return CRM_Core_DAO::singleValueQuery($query);
   }
 
   /**
@@ -266,7 +266,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
                   AND cs.pcp_display_in_roll = 1
                   AND contribution_status_id = 1
                   AND is_test = 0";
-    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query);
     $honor = array();
     while ($dao->fetch()) {
       $honor[$dao->id]['nickname'] = ucwords($dao->pcp_roll_nickname);
index 23920741a52aa1448603526a22f0e58d0d8ed449..ed0034cdd7892422027562172d96b395d6d988c1 100644 (file)
@@ -355,7 +355,7 @@ GROUP BY  currency
     $end = substr($endDate, 0, 8);
     $pCount = 0;
     $pamount = array();
-    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
       $pCount += $dao->pledge_count;
       $pamount[] = CRM_Utils_Money::format($dao->pledge_amount, $dao->currency);
@@ -417,7 +417,7 @@ GROUP BY  currency
  GROUP BY  cp.currency
 ";
     if ($select) {
-      $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+      $dao = CRM_Core_DAO::executeQuery($query);
       $amount = array();
       $count = 0;
 
index db176d6fd03d0766c5bf23acdfa7da375c3db57c..705514cdc989807eb41f72f03949dda4fbed193d 100644 (file)
@@ -54,7 +54,7 @@ class CRM_Pledge_Form_Task_SearchTaskHookSample extends CRM_Pledge_Form_Task {
 INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id )
      WHERE plg.id IN ( $pledgeIDs )";
 
-    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
       $rows[] = array(
         'display_name' => $dao->display_name,
index 170e6539fd619a887740801e46e875ab7880bdfc..0f95977bf407ed10bd8e991c67c7113f2bd1ecc0 100644 (file)
@@ -356,9 +356,7 @@ class org_civicrm_search_activityimplementsCRM_Contact_Form_Search_Interface {
   function count() {
     $sql = $this->all();
 
-    $dao = CRM_Core_DAO::executeQuery($sql,
-      CRM_Core_DAO::$_nullArray
-    );
+    $dao = CRM_Core_DAO::executeQuery($sql);
     return $dao->N;
   }
 
index 2c5dd5e509c985f855be73c2922265d9b3b7fea6..b474874799f81589974fbb57f46474a526b0322c 100644 (file)
@@ -137,7 +137,7 @@ SELECT $selectString, $whereField as contact_id
     $sql .= " AND $additionalWhereCond";
   }
 
-  $dao = &CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+  $dao = CRM_Core_DAO::executeQuery($sql);
   while ($dao->fetch()) {
     foreach ($fields as $fld => $name) {
       if (empty($dao->$fld)) {
@@ -218,7 +218,7 @@ WHERE l.entity_table = 'civicrm_contact'
     'supplemental_address_2', 'city', 'postal_code', 'county', 'state',
     'country', 'email', 'phone', 'im',
   );
-  $dao = &CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+  $dao = CRM_Core_DAO::executeQuery($sql);
   while ($dao->fetch()) {
     foreach ($fields as $fld) {
       if (empty($dao->$fld)) {
@@ -252,7 +252,7 @@ $sql = <<<EOT
 SELECT id
 FROM civicrm_contact
 EOT;
-$dao = &CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
+$dao = CRM_Core_DAO::executeQuery($sql);
 
 $contactIDs = array();
 while ($dao->fetch()) {