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
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\geofield\Plugin\GeofieldBackendBase implements ContainerFactoryPluginInterface, GeofieldBackendPluginInterface
- class \Drupal\geofield\Plugin\GeofieldBackend\GeofieldBackendDefault
- class \Drupal\geofield\Plugin\GeofieldBackendBase implements ContainerFactoryPluginInterface, GeofieldBackendPluginInterface
Expanded class hierarchy of GeofieldBackendDefault
File
- src/
Plugin/ GeofieldBackend/ GeofieldBackendDefault.php, line 18
Namespace
Drupal\geofield\Plugin\GeofieldBackendView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GeofieldBackendBase:: |
protected | property | The geoPhpWrapper service. | |
GeofieldBackendBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
GeofieldBackendBase:: |
public | function |
Constructs the GeofieldBackendDefault. Overrides PluginBase:: |
|
GeofieldBackendDefault:: |
public | function |
Saves the Geo value into the Specific Backend Format. Overrides GeofieldBackendPluginInterface:: |
|
GeofieldBackendDefault:: |
public | function |
Provides the specific database schema for the specific backend. Overrides GeofieldBackendPluginInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |