function DecimalItem::schema

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php \Drupal\Core\Field\Plugin\Field\FieldType\DecimalItem::schema()
  2. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php \Drupal\Core\Field\Plugin\Field\FieldType\DecimalItem::schema()
  3. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php \Drupal\Core\Field\Plugin\Field\FieldType\DecimalItem::schema()

Overrides FieldItemInterface::schema

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php, line 54

Class

DecimalItem
Defines the 'decimal' field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function schema(FieldStorageDefinitionInterface $field_definition) {
    return [
        'columns' => [
            'value' => [
                'type' => 'numeric',
                'precision' => $field_definition->getSetting('precision'),
                'scale' => $field_definition->getSetting('scale'),
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.