public function SearchApiViewsHandlerArgumentLocationBbox::query in Search API Location 7.2
Set up the query for this argument.
The argument sent may be found at $this->argument.
Overrides SearchApiViewsHandlerArgument::query
File
- search_api_location_views/
handler_argument_bbox.inc, line 37 - Contains SearchApiViewsHandlerArgumentLocationBbox.
Class
- SearchApiViewsHandlerArgumentLocationBbox
- Provides an argument handler for filtering location fields to a bounding box.
Code
public function query($group_by = FALSE) {
// Split the bbox string into an array.
if ($bbox = $this
->parseCorners($this->argument)) {
$location_options = $this->query
->getOption('search_api_location', array());
$location_options[] = array(
'field' => $this->real_field,
'bbox' => $bbox,
);
// Add it to the query.
$this->query
->setOption('search_api_location', $location_options);
}
}