You are here

function feeds_tamper_convert_boolean_validate in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 plugins/convert_boolean.inc \feeds_tamper_convert_boolean_validate()
1 string reference to 'feeds_tamper_convert_boolean_validate'
convert_boolean.inc in plugins/convert_boolean.inc

File

plugins/convert_boolean.inc, line 54

Code

function feeds_tamper_convert_boolean_validate(&$settings) {
  if (!$settings['match_case']) {
    $settings['false_value'] = drupal_strtolower($settings['false_value']);
    $settings['true_value'] = drupal_strtolower($settings['true_value']);
  }
  switch ($settings['no_match']) {
    case 'true':
      $settings['no_match_value'] = TRUE;
      break;
    case 'false':
      $settings['no_match_value'] = FALSE;
      break;
    case 'null':
      $settings['no_match_value'] = NULL;
      break;
    case 'other':
      $settings['no_match_value'] = $settings['other_text'];
      break;
  }
}