You are here

abstract class GeofieldBackendBase in Geofield 8

Defines a base class for geofield backends.

A complete sample plugin definition should be defined as in this example:


@GeofieldBackend(
  id = "geofield_backend_default",
  admin_label = @Translation("Default Backend")
)

Hierarchy

Expanded class hierarchy of GeofieldBackendBase

See also

\Drupal\geofield\Annotation\GeofieldBackend

\Drupal\geofield\Plugin\GeofieldBackendPluginInterface

\Drupal\geofield\Plugin\GeofieldBackendManager

Plugin API

2 files declare their use of GeofieldBackendBase
GeofieldBackendDefault.php in src/Plugin/GeofieldBackend/GeofieldBackendDefault.php
GeofieldBackendPostgis.php in src/Plugin/GeofieldBackend/GeofieldBackendPostgis.php

File

src/Plugin/GeofieldBackendBase.php, line 27

Namespace

Drupal\geofield\Plugin
View source
abstract class GeofieldBackendBase extends PluginBase implements GeofieldBackendPluginInterface, ContainerFactoryPluginInterface {

  /**
   * The geoPhpWrapper service.
   *
   * @var \Drupal\geofield\GeoPHP\GeoPHPInterface
   */
  protected $geoPhpWrapper;

  /**
   * Constructs the GeofieldBackendDefault.
   *
   * @param array $configuration
   *   The configuration.
   * @param string $plugin_id
   *   The plugin ID for the migration process to do.
   * @param mixed $plugin_definition
   *   The configuration for the plugin.
   * @param \Drupal\geofield\GeoPHP\GeoPHPInterface $geophp_wrapper
   *   The geoPhpWrapper.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, GeoPHPInterface $geophp_wrapper) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->geoPhpWrapper = $geophp_wrapper;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('geofield.geophp'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GeofieldBackendBase::$geoPhpWrapper protected property The geoPhpWrapper service.
GeofieldBackendBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
GeofieldBackendBase::__construct public function Constructs the GeofieldBackendDefault. Overrides PluginBase::__construct
GeofieldBackendPluginInterface::save public function Saves the Geo value into the Specific Backend Format. 2
GeofieldBackendPluginInterface::schema public function Provides the specific database schema for the specific backend. 2
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.