You are here

public static function ALProfilesContext::getOptions in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift_profiles/plugins/visitor_context/ALProfilesContext.inc \ALProfilesContext::getOptions()

Implements PersonalizeContextInterface::getOptions().

1 call to ALProfilesContext::getOptions()
ALProfilesContext::getPossibleValues in acquia_lift_profiles/plugins/visitor_context/ALProfilesContext.inc
Implements PersonalizeContextInterface::getPossibleValues().

File

acquia_lift_profiles/plugins/visitor_context/ALProfilesContext.inc, line 26
Provides a context plugin for Acquia Lift Profiles

Class

ALProfilesContext
@file Provides a context plugin for Acquia Lift Profiles

Code

public static function getOptions() {
  $options = array();
  try {
    $acquia_lift_profiles_api = ALProfilesAPI::getInstance();
    $segments = $acquia_lift_profiles_api
      ->getSegments();
    if (!empty($segments)) {
      foreach ($segments as $segment) {
        $options[$segment] = array(
          'name' => $segment,
          'group' => 'Acquia Lift Profiles segments',
          'cache_type' => 'local',
          'cache_expiration' => 'none',
        );
      }
    }
  } catch (Exception $e) {
    drupal_set_message($e
      ->getMessage(), 'error');
  }
  return $options;
}