From: Aidan Saunders Date: Mon, 3 Dec 2018 14:05:46 +0000 (+0000) Subject: First round of '$dao->free()' removals X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3f7d0c0fcdd4258c8fd370f7af4e9e867ac31dae;p=civicrm-core.git First round of '$dao->free()' removals --- diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 0e4260c3ef..c78b6f6ded 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -396,7 +396,6 @@ WHERE cc.contact_id = %1 AND civicrm_case_type.name = '{$caseType}'"; $caseArray[] = $dao->id; } - $dao->free(); return $caseArray; } @@ -894,7 +893,6 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c $values[$rid]['relationship_direction'] = $dao->relationship_direction; } - $dao->free(); return $values; } @@ -1218,7 +1216,6 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c $caseActivities[$caseActivityId]['links'] = $url; } - $dao->free(); $caseActivitiesDT = array(); $caseActivitiesDT['data'] = array_values($caseActivities); @@ -1318,7 +1315,6 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c $values[] = $details; } } - $dao->free(); return $values; } @@ -1802,7 +1798,6 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c $values[$dao->id]['id'] = $dao->id; $values[$dao->id]['activity_date'] = $dao->activity_date; } - $dao->free(); return $values; } @@ -2007,7 +2002,6 @@ SELECT civicrm_contact.id as casemanager_id, while ($dao->fetch()) { $relatedCaseIds[$dao->case_id] = $dao->case_id; } - $dao->free(); return array_values($relatedCaseIds); } @@ -2080,7 +2074,6 @@ SELECT civicrm_contact.id as casemanager_id, 'links' => $caseView, ); } - $dao->free(); return $relatedCases; } @@ -2254,7 +2247,6 @@ SELECT id while ($dao->fetch()) { $singletonActivityIds[] = $dao->id; } - $dao->free(); } } diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 9e59eb0327..f73eb8a949 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -2553,7 +2553,6 @@ LEFT JOIN civicrm_email ON ( civicrm_contact.id = civicrm_email.contact_id ) if ($dao->fetch()) { $email = $dao->email; } - $dao->free(); return $email; } @@ -2581,7 +2580,6 @@ AND civicrm_openid.is_primary = 1"; if ($dao->fetch()) { $openId = $dao->openid; } - $dao->free(); return $openId; } @@ -3559,7 +3557,6 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id ) $dao->save(); } } - $dao->free(); } CRM_Utils_Hook::post('delete', $type, $id, $obj); $obj->free(); diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 71497d2e24..13efcf013d 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4525,7 +4525,6 @@ civicrm_relationship.start_date > {$today} while ($dao->fetch()) { if ($count) { $noRows = $dao->rowCount; - $dao->free(); return array($noRows, NULL); } $val = $query->store($dao); @@ -4536,7 +4535,6 @@ civicrm_relationship.start_date > {$today} } $values[$dao->$entityIDField] = $val; } - $dao->free(); return array($values, $options); } @@ -4941,7 +4939,6 @@ civicrm_relationship.start_date > {$today} while ($dao->fetch()) { $ids[] = $dao->id; } - $dao->free(); return implode(',', $ids); } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index bd850cf2ab..47606b2fa9 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -890,7 +890,6 @@ class CRM_Core_DAO extends DB_DataObject { while ($dao->fetch()) { $values[] = $dao->TABLE_NAME; } - $dao->free(); return $values; } @@ -941,7 +940,6 @@ class CRM_Core_DAO extends DB_DataObject { CRM_Core_Error::fatal(); } - $dao->free(); $show[$tableName] = $dao->Create_Table; } @@ -969,7 +967,6 @@ class CRM_Core_DAO extends DB_DataObject { CRM_Core_Error::fatal(); } - $dao->free(); $show[$tableName] = $dao->Create_Table; } @@ -1005,7 +1002,6 @@ class CRM_Core_DAO extends DB_DataObject { CRM_Core_Error::fatal(); } - $dao->free(); $show[$tableName] = $dao->Create_Table; } $constraint = "`FK_{$tableName}_{$columnName}`"; @@ -1027,7 +1023,6 @@ class CRM_Core_DAO extends DB_DataObject { $query = "SELECT * FROM $tableName WHERE $columnName != '$columnValue'"; $dao = CRM_Core_DAO::executeQuery($query); $result = $dao->fetch() ? FALSE : TRUE; - $dao->free(); return $result; } @@ -1044,7 +1039,6 @@ class CRM_Core_DAO extends DB_DataObject { $query = "SELECT * FROM $tableName WHERE $columnName IS NOT NULL"; $dao = CRM_Core_DAO::executeQuery($query); $result = $dao->fetch() ? FALSE : TRUE; - $dao->free(); return $result; } @@ -1065,7 +1059,6 @@ LIKE %1 $dao = CRM_Core_DAO::executeQuery($query, $params); $result = $dao->fetch() ? TRUE : FALSE; - $dao->free(); return $result; } @@ -1432,7 +1425,6 @@ FROM civicrm_domain ) { // we typically do this for insert/update/delete statements OR if explicitly asked to // free the dao - $dao->free(); } return $dao; }