You are here

public function GeofieldBackendDefault::save in Geofield 8

Saves the Geo value into the Specific Backend Format.

Parameters

mixed|null $geometry: The Geometry to save.

Return value

mixed|null The specific backend format value.

Overrides GeofieldBackendPluginInterface::save

File

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

Class

GeofieldBackendDefault
Default backend for Geofield.

Namespace

Drupal\geofield\Plugin\GeofieldBackend

Code

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