}
}
+ /**
+ * FIXME: This function should not be needed, because the cache table should not be getting truncated
+ */
+ static function fillIfEmpty() {
+ if (!CRM_Core_DAO::singleValueQuery("SELECT COUNT(id) FROM civicrm_group_contact_cache")) {
+ self::loadAll();
+ }
+ }
+
+ /**
+ * @param $groupID
+ */
static function add($groupID) {
// first delete the current cache
self::remove($groupID);
}
}
+ /**
+ * @param $groupID
+ * @param $values
+ */
static function store(&$groupID, &$values) {
$processed = FALSE;
$customClass =
CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID);
$searchSQL = $customClass->contactIDs();
+ $searchSQL = str_replace('ORDER BY contact_a.id ASC', '', $searchSQL);
$idName = 'contact_id';
}
else {
$lock->release();
}
+ /**
+ * @return int
+ */
static function smartGroupCacheTimeout() {
$config = CRM_Core_Config::singleton();
$contactGroup[$prevContactID]['groupTitle'] = implode(', ', $contactGroup[$prevContactID]['groupTitle']);
}
- if (is_numeric($contactID)) {
+ if ((!empty($contactGroup[$contactID]) && is_numeric($contactID))) {
return $contactGroup[$contactID];
}
else {