Skip to content

Commit

Permalink
First round of '$dao->free()' removals
Browse files Browse the repository at this point in the history
  • Loading branch information
aydun committed Dec 3, 2018
1 parent c08e3ee commit 3f7d0c0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
8 changes: 0 additions & 8 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ public static function retrieveCaseIdsByContactId($contactID, $includeDeleted =
$caseArray[] = $dao->id;
}

$dao->free();
return $caseArray;
}

Expand Down Expand Up @@ -894,7 +893,6 @@ public static function getCaseRoles($contactID, $caseID, $relationshipID = NULL,
$values[$rid]['relationship_direction'] = $dao->relationship_direction;
}

$dao->free();
return $values;
}

Expand Down Expand Up @@ -1218,7 +1216,6 @@ public static function getCaseActivity($caseID, &$params, $contactID, $context =

$caseActivities[$caseActivityId]['links'] = $url;
}
$dao->free();

$caseActivitiesDT = array();
$caseActivitiesDT['data'] = array_values($caseActivities);
Expand Down Expand Up @@ -1318,7 +1315,6 @@ public static function getRelatedContacts($caseID, $includeDetails = TRUE) {
$values[] = $details;
}
}
$dao->free();

return $values;
}
Expand Down Expand Up @@ -1802,7 +1798,6 @@ public static function getCaseActivityDates($caseID, $criteriaParams = array(),
$values[$dao->id]['id'] = $dao->id;
$values[$dao->id]['activity_date'] = $dao->activity_date;
}
$dao->free();
return $values;
}

Expand Down Expand Up @@ -2007,7 +2002,6 @@ public static function getRelatedCaseIds($caseId, $excludeDeleted = TRUE) {
while ($dao->fetch()) {
$relatedCaseIds[$dao->case_id] = $dao->case_id;
}
$dao->free();

return array_values($relatedCaseIds);
}
Expand Down Expand Up @@ -2080,7 +2074,6 @@ public static function getRelatedCases($caseId, $excludeDeleted = TRUE) {
'links' => $caseView,
);
}
$dao->free();

return $relatedCases;
}
Expand Down Expand Up @@ -2254,7 +2247,6 @@ public static function mergeCases(
while ($dao->fetch()) {
$singletonActivityIds[] = $dao->id;
}
$dao->free();
}
}

Expand Down
3 changes: 0 additions & 3 deletions CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,6 @@ public static function getPrimaryEmail($contactID) {
if ($dao->fetch()) {
$email = $dao->email;
}
$dao->free();
return $email;
}

Expand Down Expand Up @@ -2581,7 +2580,6 @@ public static function getPrimaryOpenId($contactID) {
if ($dao->fetch()) {
$openId = $dao->openid;
}
$dao->free();
return $openId;
}

Expand Down Expand Up @@ -3559,7 +3557,6 @@ public static function deleteObjectWithPrimary($type, $id) {
$dao->save();
}
}
$dao->free();
}
CRM_Utils_Hook::post('delete', $type, $id, $obj);
$obj->free();
Expand Down
3 changes: 0 additions & 3 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4525,7 +4525,6 @@ public static function apiQuery(
while ($dao->fetch()) {
if ($count) {
$noRows = $dao->rowCount;
$dao->free();
return array($noRows, NULL);
}
$val = $query->store($dao);
Expand All @@ -4536,7 +4535,6 @@ public static function apiQuery(
}
$values[$dao->$entityIDField] = $val;
}
$dao->free();
return array($values, $options);
}

Expand Down Expand Up @@ -4941,7 +4939,6 @@ public function searchQuery(
while ($dao->fetch()) {
$ids[] = $dao->id;
}
$dao->free();
return implode(',', $ids);
}

Expand Down
8 changes: 0 additions & 8 deletions CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,6 @@ public static function getTableNames() {
while ($dao->fetch()) {
$values[] = $dao->TABLE_NAME;
}
$dao->free();
return $values;
}

Expand Down Expand Up @@ -941,7 +940,6 @@ public static function checkConstraintExists($tableName, $constraint) {
CRM_Core_Error::fatal();
}

$dao->free();
$show[$tableName] = $dao->Create_Table;
}

Expand Down Expand Up @@ -969,7 +967,6 @@ public static function schemaRequiresRebuilding($tables = array("civicrm_contact
CRM_Core_Error::fatal();
}

$dao->free();
$show[$tableName] = $dao->Create_Table;
}

Expand Down Expand Up @@ -1005,7 +1002,6 @@ public static function checkFKConstraintInFormat($tableName, $columnName) {
CRM_Core_Error::fatal();
}

$dao->free();
$show[$tableName] = $dao->Create_Table;
}
$constraint = "`FK_{$tableName}_{$columnName}`";
Expand All @@ -1027,7 +1023,6 @@ public static function checkFieldHasAlwaysValue($tableName, $columnName, $column
$query = "SELECT * FROM $tableName WHERE $columnName != '$columnValue'";
$dao = CRM_Core_DAO::executeQuery($query);
$result = $dao->fetch() ? FALSE : TRUE;
$dao->free();
return $result;
}

Expand All @@ -1044,7 +1039,6 @@ public static function checkFieldIsAlwaysNull($tableName, $columnName) {
$query = "SELECT * FROM $tableName WHERE $columnName IS NOT NULL";
$dao = CRM_Core_DAO::executeQuery($query);
$result = $dao->fetch() ? FALSE : TRUE;
$dao->free();
return $result;
}

Expand All @@ -1065,7 +1059,6 @@ public static function checkTableExists($tableName) {

$dao = CRM_Core_DAO::executeQuery($query, $params);
$result = $dao->fetch() ? TRUE : FALSE;
$dao->free();
return $result;
}

Expand Down Expand Up @@ -1432,7 +1425,6 @@ public static function &executeQuery(
) {
// we typically do this for insert/update/delete statements OR if explicitly asked to
// free the dao
$dao->free();
}
return $dao;
}
Expand Down

0 comments on commit 3f7d0c0

Please sign in to comment.