class GeofieldBackendPostgis in Geofield 8
PostgreSQL/PostGIS Backend for Geofield.
Plugin annotation
@GeofieldBackend(
id = "geofield_backend_postgis",
admin_label = @Translation("PostGIS Geometry"),
description = @Translation("Geofield Backend storing values in EWKB Format, suitable for PostgreSQL/PostGIS (needs PostGis enabled)")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\geofield\Plugin\GeofieldBackendBase implements ContainerFactoryPluginInterface, GeofieldBackendPluginInterface
- class \Drupal\geofield\Plugin\GeofieldBackend\GeofieldBackendPostgis
- class \Drupal\geofield\Plugin\GeofieldBackendBase implements ContainerFactoryPluginInterface, GeofieldBackendPluginInterface
Expanded class hierarchy of GeofieldBackendPostgis
File
- src/
Plugin/ GeofieldBackend/ GeofieldBackendPostgis.php, line 16
Namespace
Drupal\geofield\Plugin\GeofieldBackendView source
class GeofieldBackendPostgis extends GeofieldBackendBase {
/**
* {@inheritdoc}
*/
public function schema() {
return [
'type' => 'blob',
'not null' => FALSE,
'pgsql_type' => 'geometry',
];
}
/**
* {@inheritdoc}
*/
public function save($geometry) {
$geom = $this->geoPhpWrapper
->load($geometry);
$unpacked = unpack('H*', $geom
->out('ewkb'));
return $unpacked[1];
}
}
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:: |
|
GeofieldBackendPostgis:: |
public | function |
Saves the Geo value into the Specific Backend Format. Overrides GeofieldBackendPluginInterface:: |
|
GeofieldBackendPostgis:: |
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. |