You are here

protected static function Dimension::_defaultStorageSettings in Dimension 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::_defaultStorageSettings()
  2. 2.0.x src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::_defaultStorageSettings()

Parameters

$fields:

Return value

int[]

3 calls to Dimension::_defaultStorageSettings()
Area::defaultStorageSettings in src/Plugin/Field/FieldType/Area.php
Defines the storage-level settings for this plugin.
Length::defaultStorageSettings in src/Plugin/Field/FieldType/Length.php
Defines the storage-level settings for this plugin.
Volume::defaultStorageSettings in src/Plugin/Field/FieldType/Volume.php
Defines the storage-level settings for this plugin.

File

src/Plugin/Field/FieldType/Dimension.php, line 19

Class

Dimension

Namespace

Drupal\dimension\Plugin\Field\FieldType

Code

protected static function _defaultStorageSettings($fields) : array {
  $settings = [
    'value_precision' => 10,
    'value_scale' => 2,
  ];
  foreach ($fields as $key => $label) {
    $settings[$key . '_precision'] = 10;
    $settings[$key . '_scale'] = 2;
  }
  return $settings;
}