You are here

public static function TextWithTitle::schema in Text with Title Field 8

Field type schema definition.

Inside this method we defines the database schema used to store data for our field type.

Here there is a list of allowed column types: https://goo.gl/YY3G7s

Overrides FieldItemInterface::schema

File

src/Plugin/Field/FieldType/TextWithTitle.php, line 49

Class

TextWithTitle
Plugin implementation of the 'Text Title' field type.

Namespace

Drupal\text_with_title\Plugin\Field\FieldType

Code

public static function schema(StorageDefinition $storage) {
  $columns = [];
  $columns['title'] = [
    'type' => 'varchar',
    'length' => 255,
  ];
  $columns['text'] = [
    'type' => 'blob',
    'size' => 'big',
    'serialize' => TRUE,
  ];
  return [
    'columns' => $columns,
    'indexes' => [],
  ];
}