You are here

protected function ProximityFilter::defineOptions in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::defineOptions()
  2. 8.2 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides NumericFilter::defineOptions

File

src/Plugin/views/filter/ProximityFilter.php, line 70

Class

ProximityFilter
Filter handler for search keywords.

Namespace

Drupal\geolocation\Plugin\views\filter

Code

protected function defineOptions() {

  // Add source, lat, lng and filter.
  $options = [
    'proximity_source' => [
      'default' => 'direct_input',
    ],
    'proximity_lat' => [
      'default' => '',
    ],
    'proximity_lng' => [
      'default' => '',
    ],
    'proximity_units' => [
      'default' => 'km',
    ],
    'proximity_argument' => [
      'default' => '',
    ],
    'entity_id_argument' => [
      'default' => '',
    ],
    'boundary_filter' => [
      'default' => '',
    ],
    'client_location' => [
      'default' => 0,
    ],
  ] + parent::defineOptions();
  $options['expose']['contains']['input_by_geocoding_widget'] = [
    'default' => FALSE,
  ];
  $options['expose']['contains']['geocoder_plugin_settings'] = [
    'default' => [
      'plugin_id' => '',
      'settings' => [],
    ],
  ];
  return $options;
}