You are here

interface LocationInputInterface in Geolocation Field 8.2

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

Defines an interface for geolocation LocationInput plugins.

Hierarchy

Expanded class hierarchy of LocationInputInterface

All classes that implement LocationInputInterface

4 files declare their use of LocationInputInterface
ClientLocation.php in src/Plugin/geolocation/LocationInput/ClientLocation.php
Coordinates.php in src/Plugin/geolocation/LocationInput/Coordinates.php
Geocoder.php in src/Plugin/geolocation/LocationInput/Geocoder.php
Location.php in src/Plugin/geolocation/LocationInput/Location.php

File

src/LocationInputInterface.php, line 10

Namespace

Drupal\geolocation
View source
interface LocationInputInterface extends PluginInspectionInterface {

  /**
   * Provide a populated settings array.
   *
   * @return array
   *   The settings array with the default plugin settings.
   */
  public static function getDefaultSettings();

  /**
   * Provide LocationInput option specific settings.
   *
   * @param array $settings
   *   Current settings.
   *
   * @return array
   *   An array only containing keys defined in this plugin.
   */
  public function getSettings(array $settings);

  /**
   * Settings form by ID and context.
   *
   * @param int $center_option_id
   *   LocationInput option ID.
   * @param array $settings
   *   The current option settings.
   * @param mixed $context
   *   Current context.
   *
   * @return array
   *   A form array to be integrated in whatever.
   */
  public function getSettingsForm($center_option_id, array $settings, $context = NULL);

  /**
   * For one LocationInput (i.e. boundary filter), return all options.
   *
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   Available center options indexed by ID.
   */
  public function getAvailableLocationInputOptions($context);

  /**
   * Get center value.
   *
   * @param mixed $form_value
   *   Form value.
   * @param int $center_option_id
   *   LocationInput option ID.
   * @param array $center_option_settings
   *   The current feature settings.
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   Render array.
   */
  public function getCoordinates($form_value, $center_option_id, array $center_option_settings, $context = NULL);

  /**
   * Get center form.
   *
   * @param int $center_option_id
   *   LocationInput option ID.
   * @param array $center_option_settings
   *   The current feature settings.
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   * @param array $default_value
   *   Optional form values.
   *
   * @return array
   *   Form.
   */
  public function getForm($center_option_id, array $center_option_settings, $context = NULL, array $default_value = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
LocationInputInterface::getAvailableLocationInputOptions public function For one LocationInput (i.e. boundary filter), return all options. 1
LocationInputInterface::getCoordinates public function Get center value. 1
LocationInputInterface::getDefaultSettings public static function Provide a populated settings array. 1
LocationInputInterface::getForm public function Get center form. 1
LocationInputInterface::getSettings public function Provide LocationInput option specific settings. 1
LocationInputInterface::getSettingsForm public function Settings form by ID and context. 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