public function ProximitySort::query in Geolocation Field 8.3
Same name and namespace in other branches
- 8 src/Plugin/views/sort/ProximitySort.php \Drupal\geolocation\Plugin\views\sort\ProximitySort::query()
- 8.2 src/Plugin/views/sort/ProximitySort.php \Drupal\geolocation\Plugin\views\sort\ProximitySort::query()
Called to add the sort to a query.
Overrides SortPluginBase::query
File
- src/
Plugin/ views/ sort/ ProximitySort.php, line 20
Class
- ProximitySort
- Sort handler for geolocation field.
Namespace
Drupal\geolocation\Plugin\views\sortCode
public function query() {
if (!$this->query instanceof Sql) {
return;
}
$field = $this->displayHandler
->getHandler('field', $this->field);
if (!empty($field->field_alias) && $field->field_alias != 'unknown') {
$this->query
->addOrderBy(NULL, NULL, $this->options['order'], $field->field_alias);
$this->tableAlias = $field->tableAlias;
}
}