You are here

protected function WebformSettings::mapFormat in Migrate Webform 7

File

./settings.inc, line 59

Class

WebformSettings

Code

protected function mapFormat($format) {
  if (!is_array($format)) {
    $format = array(
      $format,
    );
  }
  $result = array();
  foreach ($format as $format_value) {
    if (isset($format_value) && isset($this->formatMappings[$format_value])) {
      $result[] = $this->formatMappings[$format_value];
    }
    else {
      $result[] = NULL;
    }
  }

  // Only return an array if we have to
  if (count($result) > 1) {
    return $result;
  }
  else {
    return reset($result);
  }
}