You are here

interface GeocoderInterface in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 src/GeocoderInterface.php \Drupal\geolocation\GeocoderInterface
  2. 8.2 src/GeocoderInterface.php \Drupal\geolocation\GeocoderInterface

Defines an interface for geolocation geocoder plugins.

Hierarchy

Expanded class hierarchy of GeocoderInterface

All classes that implement GeocoderInterface

File

src/GeocoderInterface.php, line 11

Namespace

Drupal\geolocation
View source
interface GeocoderInterface extends PluginInspectionInterface {

  /**
   * Return additional options form.
   *
   * @return array
   *   Options form.
   */
  public function getOptionsForm();

  /**
   * Process the form built above.
   *
   * @param array $form_element
   *   Options form.
   *
   * @return array|null
   *   Settings to store or NULL.
   */
  public function processOptionsForm(array $form_element);

  /**
   * Attach geocoding logic to input element.
   *
   * @param array $render_array
   *   Form containing the input element.
   * @param string $element_name
   *   Name of the input element.
   *
   * @return array|null
   *   Updated form element or NULL.
   */
  public function formAttachGeocoder(array &$render_array, $element_name);

  /**
   * Process from as altered above.
   *
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Input values.
   *
   * @return bool
   *   True of false.
   */
  public function formValidateInput(FormStateInterface $form_state);

  /**
   * Process from as altered above.
   *
   * @param array $input
   *   Input values.
   * @param string $element_name
   *   Name of the input element.
   *
   * @return array|bool
   *   Location data.
   */
  public function formProcessInput(array &$input, $element_name);

  /**
   * Geocode an address.
   *
   * @param string $address
   *   Address to geocode.
   *
   * @return array||null
   *   Location or NULL.
   */
  public function geocode($address);

}

Members

Namesort descending Modifiers Type Description Overrides
GeocoderInterface::formAttachGeocoder public function Attach geocoding logic to input element. 1
GeocoderInterface::formProcessInput public function Process from as altered above. 1
GeocoderInterface::formValidateInput public function Process from as altered above. 1
GeocoderInterface::geocode public function Geocode an address. 1
GeocoderInterface::getOptionsForm public function Return additional options form. 1
GeocoderInterface::processOptionsForm public function Process the form built above. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2