You are here

function acquia_lift_personalize_option_set_presave in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift.module \acquia_lift_personalize_option_set_presave()

Implements hook_personalize_option_set_presave().

File

./acquia_lift.module, line 673
acquia_lift.module Provides Acquia Lift-specific personalization functionality.

Code

function acquia_lift_personalize_option_set_presave($option_set) {
  $agent = personalize_agent_load($option_set->agent);

  // We are only concerned here with SimpleAB agents.
  if (!$agent || $agent->plugin != 'acquia_lift_simple_ab') {
    return;
  }

  // SimpleAB agents can only have one variation set, meaning all option
  // sets for that agent are part of the same variation set, as specified
  // by the decision name. We name the decision after the agent.
  $option_set->decision_name = $option_set->agent;
}