interface GeofieldProximitySourceInterface in Geofield 8
Defines an interface for Geofield Proximity Source plugins.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface
- interface \Drupal\geofield\Plugin\GeofieldProximitySourceInterface
Expanded class hierarchy of GeofieldProximitySourceInterface
All classes that implement GeofieldProximitySourceInterface
File
- src/
Plugin/ GeofieldProximitySourceInterface.php, line 12
Namespace
Drupal\geofield\PluginView source
interface GeofieldProximitySourceInterface extends PluginInspectionInterface {
/**
* Check for a valid couple of latitude and longitude.
*
* @param float $lat
* The latitude value.
* @param float $lon
* The longitude value.
*
* @return bool
* The flag indicates whether location is valid.
*
* @todo: add more tests, particularly around max/min values.
*/
public function isValidLocation($lat, $lon);
/**
* Check if Location is empty.
*
* @param float $lat
* The latitude value.
* @param float $lon
* The longitude value.
*
* @return bool
* The bool result.
*/
public function isEmptyLocation($lat, $lon);
/**
* Builds the specific form elements for the geofield proximity plugin.
*
* @param array $form
* The form element to build.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
* @param array $options_parents
* The values parents.
* @param bool $is_exposed
* The check/differentiate if it is part of an exposed form.
*/
public function buildOptionsForm(array &$form, FormStateInterface $form_state, array $options_parents, $is_exposed = FALSE);
/**
* Validates the options form for the geofield proximity plugin.
*
* @param array $form
* The form element to build.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
* @param array $options_parents
* The values parents.
*/
public function validateOptionsForm(array &$form, FormStateInterface $form_state, array $options_parents);
/**
* Set the units to perform the calculation in.
*
* @param string $units
* The name of the units constant to be used or string representation of it.
*/
public function setUnits($units);
/**
* Get the current units.
*
* @return string
* The name of the units constant to be used or string representation of it.
*/
public function getUnits();
/**
* Sets view handler which uses this proximity plugin.
*
* @param \Drupal\views\Plugin\views\HandlerBase $view_handler
* The view handler which uses this proximity plugin.
*/
public function setViewHandler(HandlerBase $view_handler);
/**
* Get the calculated proximity.
*
* @param float $lat
* The current point latitude.
* @param float $lon
* The current point longitude.
*
* @return float
* The calculated proximity.
*
* @throws \Drupal\geofield\Exception\InvalidPointException;
* If the proximity cannot be created, due to incorrect point coordinates
* definition.
*
* @throws \Drupal\geofield\Exception\ProximityUnavailableException;
* If any other case the proximity value cannot be created correctly.
*/
public function getProximity($lat, $lon);
/**
* Gets the haversine options.
*
* @return array
* The haversine options.
*
* @throws \Drupal\geofield\Exception\HaversineUnavailableException;
* If the haversine is unavailable, due to incorrect setup definitions.
*/
public function getHaversineOptions();
/**
* Gets the proximity distance origin.
*
* @return array
* The proximity distance origin.
*/
public function getOrigin();
/**
* Sets the proximity distance origin.
*
* @param array $origin
* The proximity distance origin.
*/
public function setOrigin(array $origin);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GeofieldProximitySourceInterface:: |
public | function | Builds the specific form elements for the geofield proximity plugin. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Gets the haversine options. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Gets the proximity distance origin. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Get the calculated proximity. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Get the current units. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Check if Location is empty. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Check for a valid couple of latitude and longitude. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Sets the proximity distance origin. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Set the units to perform the calculation in. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Sets view handler which uses this proximity plugin. | 1 |
GeofieldProximitySourceInterface:: |
public | function | Validates the options form for the geofield proximity plugin. | 1 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |