You are here

public static function DoubleField::defaultStorageSettings in Double Field 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldType/DoubleField.php \Drupal\double_field\Plugin\Field\FieldType\DoubleField::defaultStorageSettings()

Defines the storage-level settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides FieldItemBase::defaultStorageSettings

1 call to DoubleField::defaultStorageSettings()
TestBase::createField in tests/src/FunctionalJavascript/TestBase.php
Creates a field.

File

src/Plugin/Field/FieldType/DoubleField.php, line 35

Class

DoubleField
Plugin implementation of the 'double_field' field type.

Namespace

Drupal\double_field\Plugin\Field\FieldType

Code

public static function defaultStorageSettings() : array {
  $settings = [];
  foreach ([
    'first',
    'second',
  ] as $subfield) {
    $settings['storage'][$subfield] = [
      'type' => 'string',
      'maxlength' => 255,
      'precision' => 10,
      'scale' => 2,
      'datetime_type' => 'datetime',
    ];
  }
  return $settings + parent::defaultStorageSettings();
}