You are here

interface LocationInputInterface in Search API Location 8

Defines the required methods for a Location Input plugin.

Hierarchy

Expanded class hierarchy of LocationInputInterface

All classes that implement LocationInputInterface

File

src/LocationInput/LocationInputInterface.php, line 11

Namespace

Drupal\search_api_location\LocationInput
View source
interface LocationInputInterface extends PluginFormInterface {

  /**
   * Checks if the location passed in is correct for the current settings.
   *
   * @param array $input
   *   The text entered by the user, contains either "value" or "lat"+"lng" as
   *   keys.
   * @param array $settings
   *   An array of settings for the plugin.
   *
   * @return bool
   *   True if the input is successful, false otherwise.
   */
  public function hasInput(array $input, array $settings);

  /**
   * Returns the parsed user input.
   *
   * @param array $input
   *   The text entered by the user, contains either "value" or "lat"+"lng" as
   *   keys.
   *
   * @return mixed
   *   Returns a string with "latitude,longitude" if we can find a location.
   *   NULL otherwise.
   */
  public function getParsedInput(array $input);

  /**
   * Returns the label of the location input.
   *
   * @return string
   *   The administration label.
   */
  public function label();

  /**
   * Returns the description of the location input.
   *
   * @return string
   *   The administration label.
   */
  public function getDescription();

  /**
   * Returns a form to configure settings for the plugin.
   *
   * @param array $form
   *   The form where the settings form is being included in.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param array $options
   *   Option array with extra info of the plugin.
   *
   * @return array
   *   The form definition for the widget settings.
   */
  public function getForm(array $form, FormStateInterface $form_state, array $options);

}

Members

Namesort descending Modifiers Type Description Overrides
LocationInputInterface::getDescription public function Returns the description of the location input.
LocationInputInterface::getForm public function Returns a form to configure settings for the plugin. 1
LocationInputInterface::getParsedInput public function Returns the parsed user input. 3
LocationInputInterface::hasInput public function Checks if the location passed in is correct for the current settings. 1
LocationInputInterface::label public function Returns the label of the location input.
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18