function IntegerItem::schema

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

Overrides FieldItemInterface::schema

1 call to IntegerItem::schema()
EntityViewsDataTest::setupFieldStorageDefinition in core/modules/views/tests/src/Unit/EntityViewsDataTest.php
Helper method to mock all store definitions.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php, line 87

Class

IntegerItem
Defines the 'integer' field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function schema(FieldStorageDefinitionInterface $field_definition) {
    return [
        'columns' => [
            'value' => [
                'type' => 'int',
                // Expose the 'unsigned' setting in the field item schema.
'unsigned' => $field_definition->getSetting('unsigned'),
                // Expose the 'size' setting in the field item schema. For instance,
                // supply 'big' as a value to produce a 'bigint' type.
'size' => $field_definition->getSetting('size'),
            ],
        ],
    ];
}

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