You are here

function geocoder_widget_get_field_concat in Geocoder 7

Get field items and info.

We always pass the full field-item array (with all columns) to the handler, but there is some preprocessing that we need to do for the special case of entity-labels and multi-field concatenation. For these two special cases we "mock-up" a text-field and pass it back for geocoding.

1 call to geocoder_widget_get_field_concat()
geocoder_widget_get_field_value in ./geocoder.widget.inc
Get a field's value based on geocoded data.

File

./geocoder.widget.inc, line 518
geocoder.widget.inc

Code

function geocoder_widget_get_field_concat($items) {

  // Check if we should concatenate.
  $concat = '';
  foreach ($items as $item) {
    if (!empty($item['value'])) {
      $concat .= trim($item['value']) . ', ';
    }
  }
  $concat = trim($concat, ', ');
  $items = array(
    array(
      'value' => $concat,
    ),
  );
  return $items;
}