public function ViewsEntityArgument::getAvailableLocationOptions in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/geolocation/Location/ViewsEntityArgument.php \Drupal\geolocation\Plugin\geolocation\Location\ViewsEntityArgument::getAvailableLocationOptions()
For one Location (i.e. boundary filter), return all options (all filters).
Parameters
mixed $context: Context like field formatter, field widget or view.
Return value
array Available location options indexed by ID.
Overrides LocationBase::getAvailableLocationOptions
File
- src/
Plugin/ geolocation/ Location/ ViewsEntityArgument.php, line 25
Class
- ViewsEntityArgument
- Derive center from proximity argument.
Namespace
Drupal\geolocation\Plugin\geolocation\LocationCode
public function getAvailableLocationOptions($context) {
$options = [];
if ($displayHandler = self::getViewsDisplayHandler($context)) {
/** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */
foreach ($displayHandler
->getHandlers('argument') as $argument_id => $argument) {
if ($argument
->getPluginId() == 'geolocation_entity_argument') {
$options[$argument_id] = $this
->t('Entity argument') . ' - ' . $argument
->adminLabel();
}
}
}
return $options;
}