You are here

function acquia_lift_target_validate_lock_step in Acquia Lift Connector 7.2

Validate a set of option sets to see if they are valid for lock-step handling.

Parameters

array $option_sets: An array of option set stdClass objects to validate.

Return value

boolean TRUE if the option sets are valid for lock-step, false if otherwise.

2 calls to acquia_lift_target_validate_lock_step()
AcquiaLiftTarget::getMultipleOptionSetErrors in plugins/agent_types/AcquiaLiftTarget.inc
Determine the error messaging to show based on multiple variation set handling configuration for the current agent.
acquia_lift_personalize_campaign_wizard_variations_alter in ./acquia_lift.admin.wizard.inc
Alter hook for the variations portions of the campaign wizard.

File

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

Code

function acquia_lift_target_validate_lock_step($option_sets) {
  $equal_option_counts = TRUE;
  if (count($option_sets) > 1) {
    $first_os = array_shift($option_sets);
    $num_options = count($first_os->options);
    foreach ($option_sets as $os) {
      if (count($os->options) != $num_options) {
        $equal_option_counts = FALSE;
      }
    }
  }
  return $equal_option_counts;
}