You are here

interface DataProviderInterface in Geolocation Field 8.3

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

Defines an interface for geolocation DataProvider plugins.

Hierarchy

Expanded class hierarchy of DataProviderInterface

All classes that implement DataProviderInterface

6 files declare their use of DataProviderInterface
AddressFieldProvider.php in modules/geolocation_address/src/Plugin/geolocation/DataProvider/AddressFieldProvider.php
Geofield.php in modules/geolocation_geofield/src/Plugin/geolocation/DataProvider/Geofield.php
GeolocationFieldProvider.php in src/Plugin/geolocation/DataProvider/GeolocationFieldProvider.php
GeolocationGeometry.php in modules/geolocation_geometry/src/Plugin/geolocation/DataProvider/GeolocationGeometry.php
GeolocationGpx.php in modules/geolocation_gpx/src/Plugin/geolocation/DataProvider/GeolocationGpx.php

... See full list

File

src/DataProviderInterface.php, line 14

Namespace

Drupal\geolocation
View source
interface DataProviderInterface extends PluginInspectionInterface {

  /**
   * Determine valid views option.
   *
   * @param \Drupal\views\Plugin\views\field\FieldPluginBase $views_field
   *   Views field definition.
   *
   * @return bool
   *   Yes or no.
   */
  public function isViewsGeoOption(FieldPluginBase $views_field);

  /**
   * Determine valid field geo option.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
   *   Field definition.
   *
   * @return bool
   *   Yes or no.
   */
  public function isFieldGeoOption(FieldDefinitionInterface $fieldDefinition);

  /**
   * Get positions from views row.
   *
   * @param \Drupal\views\ResultRow $row
   *   Row.
   * @param \Drupal\views\Plugin\views\field\FieldPluginBase $views_field
   *   Views field definition.
   *
   * @return array
   *   Retrieved locations.
   */
  public function getPositionsFromViewsRow(ResultRow $row, FieldPluginBase $views_field = NULL);

  /**
   * Get locations from views row.
   *
   * @param \Drupal\views\ResultRow $row
   *   Row.
   * @param \Drupal\views\Plugin\views\field\FieldPluginBase $views_field
   *   Views field definition.
   *
   * @return array
   *   Renderable locations.
   */
  public function getLocationsFromViewsRow(ResultRow $row, FieldPluginBase $views_field = NULL);

  /**
   * Get shapes from views row.
   *
   * @param \Drupal\views\ResultRow $row
   *   Row.
   * @param \Drupal\views\Plugin\views\field\FieldPluginBase $views_field
   *   Views field definition.
   *
   * @return array
   *   Renderable shapes.
   */
  public function getShapesFromViewsRow(ResultRow $row, FieldPluginBase $views_field = NULL);

  /**
   * Get positions from field item list.
   *
   * @param \Drupal\Core\Field\FieldItemInterface $fieldItem
   *   Views field definition.
   *
   * @return array
   *   Retrieved coordinates.
   */
  public function getPositionsFromItem(FieldItemInterface $fieldItem);

  /**
   * Get locations from field item list.
   *
   * @param \Drupal\Core\Field\FieldItemInterface $fieldItem
   *   Views field definition.
   *
   * @return array
   *   Renderable locations.
   */
  public function getLocationsFromItem(FieldItemInterface $fieldItem);

  /**
   * Get shapes from field item list.
   *
   * @param \Drupal\Core\Field\FieldItemInterface $fieldItem
   *   Views field definition.
   *
   * @return array
   *   Renderable shapes.
   */
  public function getShapesFromItem(FieldItemInterface $fieldItem);

  /**
   * Replace field item tokens.
   *
   * @param string $text
   *   Text.
   * @param \Drupal\Core\Field\FieldItemInterface $fieldItem
   *   Field item.
   *
   * @return array
   *   Retrieved locations.
   */
  public function replaceFieldItemTokens($text, FieldItemInterface $fieldItem);

  /**
   * Return field item tokens.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinitionInterface
   *   Field definition interface.
   *
   * @return array
   *   Token help element.
   */
  public function getTokenHelp(FieldDefinitionInterface $fieldDefinitionInterface = NULL);

  /**
   * Provide data provider settings form array.
   *
   * @param array $settings
   *   The current data provider settings.
   * @param array $parents
   *   Form parents.
   *
   * @return array
   *   A form array to be integrated in whatever.
   */
  public function getSettingsForm(array $settings, array $parents = []);

  /**
   * Set views field.
   *
   * @param \Drupal\views\Plugin\views\field\FieldPluginBase $viewsField
   *   Views field.
   */
  public function setViewsField(FieldPluginBase $viewsField);

  /**
   * Set field definition.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
   *   Field definition.
   */
  public function setFieldDefinition(FieldDefinitionInterface $fieldDefinition);

}

Members

Namesort descending Modifiers Type Description Overrides
DataProviderInterface::getLocationsFromItem public function Get locations from field item list. 1
DataProviderInterface::getLocationsFromViewsRow public function Get locations from views row. 1
DataProviderInterface::getPositionsFromItem public function Get positions from field item list. 1
DataProviderInterface::getPositionsFromViewsRow public function Get positions from views row. 1
DataProviderInterface::getSettingsForm public function Provide data provider settings form array. 1
DataProviderInterface::getShapesFromItem public function Get shapes from field item list. 1
DataProviderInterface::getShapesFromViewsRow public function Get shapes from views row. 1
DataProviderInterface::getTokenHelp public function Return field item tokens. 1
DataProviderInterface::isFieldGeoOption public function Determine valid field geo option. 6
DataProviderInterface::isViewsGeoOption public function Determine valid views option. 1
DataProviderInterface::replaceFieldItemTokens public function Replace field item tokens. 1
DataProviderInterface::setFieldDefinition public function Set field definition. 1
DataProviderInterface::setViewsField public function Set views field. 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