From f870b9b50bfbdda286c44c04cfe5102fbb52e94a Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 2 May 2019 14:55:05 +1200 Subject: [PATCH] dev/core#562 remove some more instances of ->free() --- CRM/Batch/BAO/Batch.php | 1 - CRM/Core/BAO/Address.php | 1 - CRM/Core/BAO/Block.php | 1 - CRM/Core/BAO/CustomField.php | 1 - CRM/Core/BAO/CustomOption.php | 2 -- CRM/Core/BAO/CustomValueTable.php | 1 - CRM/Core/BAO/Location.php | 1 - CRM/Core/BAO/Note.php | 2 -- CRM/Core/BAO/OptionValue.php | 1 - CRM/Core/BAO/Tag.php | 3 --- CRM/Core/PseudoConstant.php | 4 ---- CRM/Financial/BAO/ExportFormat/IIF.php | 1 - CRM/Report/Form/Campaign/SurveyDetails.php | 1 - CRM/Report/Form/Contribute/Sybunt.php | 2 -- 14 files changed, 22 deletions(-) diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index aa87f7076f..fb2b2a3261 100644 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -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; } diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index b5ec97d748..3ce2b0cdbb 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -1063,7 +1063,6 @@ SELECT is_primary, $addressDAO->copyValues($params); $addressDAO->id = $dao->id; $addressDAO->save(); - $addressDAO->free(); } } diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index a9ffa34e2f..d37b01d94e 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -277,7 +277,6 @@ class CRM_Core_BAO_Block { $block->is_primary = FALSE; $block->save(); } - $block->free(); } } } diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 6dd3d5b208..19f1ce3bf5 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -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); } diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index 9fa273922b..0eb77b2cff 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -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(); } } diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 9740318b97..759e83a719 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -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; diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index 72899e0075..eecaab05c2 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -211,7 +211,6 @@ WHERE e.id = %1"; $dao->id = $id; $dao->find(TRUE); $dao->delete(); - $dao->free(); } } } diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index d30ae5bfaa..dabc8123bc 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -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'); } diff --git a/CRM/Core/BAO/OptionValue.php b/CRM/Core/BAO/OptionValue.php index a681756418..072f8cd5c0 100644 --- a/CRM/Core/BAO/OptionValue.php +++ b/CRM/Core/BAO/OptionValue.php @@ -480,7 +480,6 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { $optionValue->weight = $opWeight; $optionValue->save(); } - $optionValue->free(); } } diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index ef83365931..9007864c1c 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -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; } diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 0af4bd1e10..28984e107d 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -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 = []; diff --git a/CRM/Financial/BAO/ExportFormat/IIF.php b/CRM/Financial/BAO/ExportFormat/IIF.php index 8ff0ef4b9b..71c6153948 100644 --- a/CRM/Financial/BAO/ExportFormat/IIF.php +++ b/CRM/Financial/BAO/ExportFormat/IIF.php @@ -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 diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index e8b7f84b47..e0b7588e36 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -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; diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index 22c337eb8c..3a2cb5f47f 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -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); -- 2.25.1