You are here

function acquia_lift_sync_fixed_targeting in Acquia Lift Connector 7

Syncs fixed targeting rules to Acquia Lift.

Parameters

$agent:

$new_option_sets:

2 calls to acquia_lift_sync_fixed_targeting()
acquia_lift_personalize_option_set_delete in ./acquia_lift.module
Implements hook_personalize_option_set_delete().
acquia_lift_personalize_option_set_save in ./acquia_lift.module
Implements hook_personalize_option_set_save().

File

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

Code

function acquia_lift_sync_fixed_targeting($agent, $new_option_sets) {
  if ($agent_instance = personalize_agent_load_agent($agent->machine_name)) {
    if (!$agent_instance instanceof AcquiaLiftAgentInterface) {
      return;
    }
    try {
      $agent_instance
        ->syncFixedTargeting($new_option_sets);
    } catch (Exception $e) {
      drupal_set_message($e
        ->getMessage(), 'error');
    }
  }
}