dev/core#562 remove some more instances of ->free()
authoreileen <emcnaughton@wikimedia.org>
Thu, 2 May 2019 02:55:05 +0000 (14:55 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 2 May 2019 02:55:05 +0000 (14:55 +1200)
14 files changed:
CRM/Batch/BAO/Batch.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/Block.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/CustomOption.php
CRM/Core/BAO/CustomValueTable.php
CRM/Core/BAO/Location.php
CRM/Core/BAO/Note.php
CRM/Core/BAO/OptionValue.php
CRM/Core/BAO/Tag.php
CRM/Core/PseudoConstant.php
CRM/Financial/BAO/ExportFormat/IIF.php
CRM/Report/Form/Campaign/SurveyDetails.php
CRM/Report/Form/Contribute/Sybunt.php

index aa87f7076f52eca51fbd6a2ce5cc61e2e1785f30..fb2b2a326194d20ab2e40f98ddc18535d189a1a9 100644 (file)
@@ -560,7 +560,6 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
       while ($dao->fetch()) {
         $totals[$dao->batch_id] = (array) $dao;
       }
-      $dao->free();
     }
     return $totals;
   }
index b5ec97d74863f4ae97c01a1364d571eddc120270..3ce2b0cdbb2bd3fb783a44241d4e601cb4b78627 100644 (file)
@@ -1063,7 +1063,6 @@ SELECT is_primary,
       $addressDAO->copyValues($params);
       $addressDAO->id = $dao->id;
       $addressDAO->save();
-      $addressDAO->free();
     }
   }
 
index a9ffa34e2f4461182c95675d6de1e5b2f9f67675..d37b01d94e5d24e40af664835c94a122a3b7fd66 100644 (file)
@@ -277,7 +277,6 @@ class CRM_Core_BAO_Block {
             $block->is_primary = FALSE;
             $block->save();
           }
-          $block->free();
         }
       }
     }
index 6dd3d5b208c345ae3cc4fba20c2228a32354aaa0..19f1ce3bf50789d406807e0ee5ee85bfce13f2de 100644 (file)
@@ -2038,7 +2038,6 @@ AND    cf.id = %1";
       if (!$dao->fetch()) {
         CRM_Core_Error::fatal();
       }
-      $dao->free();
       $fieldValues = array($dao->table_name, $dao->column_name, $dao->id);
       $cache->set($cacheKey, $fieldValues);
     }
index 9fa273922bbb6d0e3027af413435b48c1c7bacfd..0eb77b2cfff97317443cae486ef77a05cdf61336 100644 (file)
@@ -348,10 +348,8 @@ SET    {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )";
         ];
       }
       $sql = "UPDATE `{$customGroup->table_name}` SET `{$customField->column_name}` = REPLACE(`{$customField->column_name}`, %1, %2) WHERE `{$customField->column_name}` LIKE %3";
-      $customGroup->free();
       CRM_Core_DAO::executeQuery($sql, $params);
     }
-    $customField->free();
   }
 
 }
index 9740318b97f10cdc1066bc6feaef27289c505817..759e83a71954d764bceecafa0e8195dd8a95b45d 100644 (file)
@@ -176,7 +176,6 @@ class CRM_Core_BAO_CustomValueTable {
               $entityFileDAO->entity_id = $field['entity_id'];
               $entityFileDAO->file_id = $field['file_id'];
               $entityFileDAO->save();
-              $entityFileDAO->free();
               $value = $field['file_id'];
               $type = 'String';
               break;
index 72899e00757a09d6550c721cd61084d85859aaaf..eecaab05c2126c5b06eba6992efadeea02b12ba1 100644 (file)
@@ -211,7 +211,6 @@ WHERE e.id = %1";
         $dao->id = $id;
         $dao->find(TRUE);
         $dao->delete();
-        $dao->free();
       }
     }
   }
index d30ae5bfaad89cf8e3fe74518f07b21b2289249c..dabc8123bc2606994f98d045d512dabed5eaeefc 100644 (file)
@@ -315,12 +315,10 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
       $childNote = new CRM_Core_DAO_Note();
       $childNote->id = $childId;
       $childNote->delete();
-      $childNote->free();
       $recent[] = $childId;
     }
 
     $return = $note->delete();
-    $note->free();
     if ($showStatus) {
       CRM_Core_Session::setStatus($status, ts('Deleted'), 'success');
     }
index a681756418c02361e4d8d56d445227fdc35bda9d..072f8cd5c051acd51faed80b05b82698ec2e4eb7 100644 (file)
@@ -480,7 +480,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
         $optionValue->weight = $opWeight;
         $optionValue->save();
       }
-      $optionValue->free();
     }
   }
 
index ef8336593152ea2e98e766f5baae152bc981725f..9007864c1c53765de4c4bd14015cf2f6690e5045 100644 (file)
@@ -185,7 +185,6 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
           $tags[$tag->id]['color'] = !empty($tag->color) ? $tag->color : NULL;
         }
       }
-      $tag->free();
     }
 
     return $tags;
@@ -270,7 +269,6 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
       }
     }
 
-    $dao->free();
     // While we have nodes left to build, shift the first (alphabetically)
     // node of the list, place it in our tags list and loop through the
     // list of unplaced nodes to find its children. We make a copy to
@@ -514,7 +512,6 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
     while ($dao->fetch()) {
       $tagSets[$dao->id] = $dao->name;
     }
-    $dao->free();
     return $tagSets;
   }
 
index 0af4bd1e105fa78cb1e19915f544dcdc8468fa14..28984e107d1c2d7571f2c3e47701901e8178e760 100644 (file)
@@ -220,14 +220,12 @@ class CRM_Core_PseudoConstant {
       if ($options && $flip) {
         $options = array_flip($options);
       }
-      $customField->free();
       return $options;
     }
 
     // Core field: load schema
     $dao = new $daoName();
     $fieldSpec = $dao->getFieldSpec($fieldName);
-    $dao->free();
 
     // Ensure we have the canonical name for this field
     $fieldName = CRM_Utils_Array::value('name', $fieldSpec, $fieldName);
@@ -313,7 +311,6 @@ class CRM_Core_PseudoConstant {
           // Get list of fields for the option table
           $dao = new $daoName();
           $availableFields = array_keys($dao->fieldKeys());
-          $dao->free();
 
           $select = "SELECT %1 AS id, %2 AS label";
           $from = "FROM %3";
@@ -375,7 +372,6 @@ class CRM_Core_PseudoConstant {
           while ($dao->fetch()) {
             $output[$dao->id] = $dao->label;
           }
-          $dao->free();
           // Localize results
           if (!empty($params['localize']) || $pseudoconstant['table'] == 'civicrm_country' || $pseudoconstant['table'] == 'civicrm_state_province') {
             $I18nParams = [];
index 8ff0ef4b9b0d02655adc6559456a87de76a2836a..71c61539489958e6cc78725bccec83378b68c4b5 100644 (file)
@@ -286,7 +286,6 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat
               'currency' => $this->format($itemDAO->currency),
             ];
           } // end items loop
-          $itemDAO->free();
         }
         else {
           // In this case, split record just uses the FROM account from the trxn, and there's only one record here
index e8b7f84b47d2791dcd037f9feca24acb6e8910dc..e0b7588e36e64585b90b56814cff2841efb8a05e 100644 (file)
@@ -655,7 +655,6 @@ INNER JOIN  civicrm_custom_group cg ON ( cg.id = cf.custom_group_id )
         $fieldValueMap[$responseField->option_group_id][$responseField->value] = $value;
       }
     }
-    $responseField->free();
 
     //actual data formatting.
     $hasData = FALSE;
index 22c337eb8cecf035d9a868ea22da108d143c9535..3a2cb5f47f1b1dfc8c1bb49847ecb16aca3812db 100644 (file)
@@ -446,7 +446,6 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form {
       while ($dao->fetch()) {
         $contactIds[] = $dao->cid;
       }
-      $dao->free();
       $this->setPager();
     }
 
@@ -497,7 +496,6 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form {
           $contributionSum = 0;
         }
       }
-      $dao->free();
     }
     // format result set.
     $this->formatDisplay($rows, FALSE);