function acquia_lift_profiles_refresh_segments_cache in Acquia Lift Connector 7.2
Same name and namespace in other branches
- 7 acquia_lift_profiles/acquia_lift_profiles.module \acquia_lift_profiles_refresh_segments_cache()
Refreshes the cached list of available Acquia Lift Profiles segments.
Return value
bool TRUE if the list was successfully refreshed, FALSE otherwise.
4 calls to acquia_lift_profiles_refresh_segments_cache()
- acquia_lift_profiles_admin_form_submit in acquia_lift_profiles/
acquia_lift_profiles.admin.inc - Submit handler for the acquia_lift_profiles configuration form.
- acquia_lift_profiles_creds_submit in acquia_lift_profiles/
acquia_lift_profiles.module - Submit callback for the Acquia Lift admin form.
- acquia_lift_profiles_get_segments in acquia_lift_profiles/
acquia_lift_profiles.module - Returns the list of availble segments.
- acquia_lift_profiles_personalize_agent_save in acquia_lift_profiles/
acquia_lift_profiles.module - Implements hook_personalize_agent_save().
File
- acquia_lift_profiles/
acquia_lift_profiles.module, line 153 - acquia_lift_profiles.module Provides Acquia Lift Profiles integration.
Code
function acquia_lift_profiles_refresh_segments_cache() {
if (!acquia_lift_profiles_is_configured(TRUE)) {
return FALSE;
}
try {
$segments = ALProfilesAPI::getInstance(variable_get('acquia_lift_profiles_account_name', ''), variable_get('acquia_lift_profiles_site_name', ''), variable_get('acquia_lift_profiles_api_url', ''))
->getSegments();
variable_set('acquia_lift_profiles_segments', $segments);
return TRUE;
} catch (Exception $e) {
watchdog('acquia_lift_profiles', $e
->getMessage());
return FALSE;
}
}