You are here

class GeofieldBackendDefault in Geofield 8

Default backend for Geofield.

Definition of a default Geofield Backend for storing values in WKT Format.

Plugin annotation


@GeofieldBackend(
  id = "geofield_backend_default",
  admin_label = @Translation("Default (WKT)"),
  description = @Translation("Default Geofield Backend for storing values in WKT Format")
)

Hierarchy

Expanded class hierarchy of GeofieldBackendDefault

File

src/Plugin/GeofieldBackend/GeofieldBackendDefault.php, line 18

Namespace

Drupal\geofield\Plugin\GeofieldBackend
View source
class GeofieldBackendDefault extends GeofieldBackendBase {

  /**
   * {@inheritdoc}
   */
  public function schema() {
    return [
      'type' => 'blob',
      'size' => 'big',
      'not null' => FALSE,
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function save($geometry) {
    $output = NULL;
    if ($geom = $this->geoPhpWrapper
      ->load($geometry)) {
      $output = $geom
        ->out('wkt');
    }
    return $output;
  }

}

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
GeofieldBackendDefault::save public function Saves the Geo value into the Specific Backend Format. Overrides GeofieldBackendPluginInterface::save
GeofieldBackendDefault::schema public function Provides the specific database schema for the specific backend. Overrides GeofieldBackendPluginInterface::schema
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.