Skip to content

Commit

Permalink
[REF] Remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Apr 25, 2021
1 parent 992654b commit 9901e78
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions CRM/Contact/BAO/GroupContactCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public static function loadAll($groupIDs = NULL, $limit = 0) {
// this function is expensive and should be sparingly used if groupIDs is empty
if (empty($groupIDs)) {
$groupIDClause = NULL;
$groupIDs = [];
}
else {
if (!is_array($groupIDs)) {
Expand Down Expand Up @@ -162,27 +161,8 @@ public static function loadAll($groupIDs = NULL, $limit = 0) {

$dao = CRM_Core_DAO::executeQuery($query);
$processGroupIDs = [];
$refreshGroupIDs = $groupIDs;
while ($dao->fetch()) {
$processGroupIDs[] = $dao->id;

// remove this id from refreshGroupIDs
foreach ($refreshGroupIDs as $idx => $gid) {
if ($gid == $dao->id) {
unset($refreshGroupIDs[$idx]);
break;
}
}
}

if (!empty($refreshGroupIDs)) {
$refreshGroupIDString = CRM_Core_DAO::escapeString(implode(', ', $refreshGroupIDs));
$query = "
UPDATE civicrm_group g
SET g.cache_date = NOW()
WHERE g.id IN ( {$refreshGroupIDString} )
";
CRM_Core_DAO::executeQuery($query);
}

if (empty($processGroupIDs)) {
Expand Down

0 comments on commit 9901e78

Please sign in to comment.