You are here

protected function SearchApiViewsHandlerArgumentLocation::_add_field_options in Search API Location 7.2

Internal function to merge options into search options for field.

3 calls to SearchApiViewsHandlerArgumentLocation::_add_field_options()
SearchApiViewsHandlerArgumentLocationGeofilt::query in search_api_location_views/handler_argument_location.inc
Set up the query for this argument.
SearchApiViewsHandlerArgumentLocationPoint::query in search_api_location_views/handler_argument_location.inc
Accepts a $this->argument of any value that geoPHP can load.
SearchApiViewsHandlerArgumentLocationRadius::query in search_api_location_views/handler_argument_location.inc
Accepts a decimal $this->argument representing the radius in km.

File

search_api_location_views/handler_argument_location.inc, line 16
Provides the views argument handler for location fields.

Class

SearchApiViewsHandlerArgumentLocation
Base class for Views location seperate point radius arguments.

Code

protected function _add_field_options(&$original_options, $add_options, $field) {
  foreach ($original_options as $key => &$field_options) {
    if ($field_options['field'] == $field) {

      // Found add options to array.
      $field_options += $add_options;
      return;
    }
  }

  // Field not yet in options, create new element.
  $add_options['field'] = $field;
  $original_options[] = $add_options;
  return;
}