You are here

protected function SearchApiFilterLocation::defineOptions in Search API Location 8

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 FilterPluginBase::defineOptions

File

modules/search_api_location_views/src/Plugin/views/filter/SearchApiFilterLocation.php, line 68

Class

SearchApiFilterLocation
Defines a filter for filtering on location fields.

Namespace

Drupal\search_api_location_views\Plugin\views\filter

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['plugin']['default'] = '';
  foreach ($this->locationInputManager
    ->getDefinitions() as $id => $plugin) {
    $options["plugin-{$id}"]['default'] = [];
  }
  $options['value'] = [
    'contains' => [
      'value' => [
        'default' => '',
      ],
      'distance' => [
        'contains' => [
          'from' => [
            'default' => '',
          ],
          'to' => [
            'default' => '',
          ],
        ],
      ],
    ],
  ];
  return $options;
}