You are here

GeolocationGeometryPoint.php in Geolocation Field 8.3

File

modules/geolocation_geometry/src/Plugin/Field/FieldType/GeolocationGeometryPoint.php
View source
<?php

namespace Drupal\geolocation_geometry\Plugin\Field\FieldType;

use Drupal\Core\Field\FieldStorageDefinitionInterface;

/**
 * Plugin implementation of the 'geolocation' field type.
 *
 * @FieldType(
 *   id = "geolocation_geometry_point",
 *   label = @Translation("Geolocation Geometry - Point"),
 *   category = @Translation("Spatial fields"),
 *   description = @Translation("This field stores spatial geometry data."),
 *   default_widget = "geolocation_geometry_wkt",
 *   default_formatter = "geolocation_geometry_wkt"
 * )
 */
class GeolocationGeometryPoint extends GeolocationGeometryBase {

  /**
   * {@inheritdoc}
   */
  public static function schema(FieldStorageDefinitionInterface $field_definition) {
    $schema = parent::schema($field_definition);
    $schema['columns']['geometry']['pgsql_type'] = "geometry('POINT')";
    $schema['columns']['geometry']['mysql_type'] = 'point';
    return $schema;
  }

}

Classes

Namesort descending Description
GeolocationGeometryPoint Plugin implementation of the 'geolocation' field type.