Same name and namespace in other branches
- 3.0.x src/Plugin/Field/FieldType/ColorFieldType.php \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType::schema()
Fichier
-
src/
Plugin/ Field/ FieldType/ ColorFieldType.php, line 93
Classe
- ColorFieldType
- Plugin implementation of the 'color_type' field type.
Namespace
Drupal\color_field\Plugin\Field\FieldTypeCode
public static function schema(FieldStorageDefinitionInterface $field_definition) {
$format = $field_definition->getSetting('format');
$color_length = isset($format) ? strlen($format) : 7;
return [
'columns' => [
'color' => [
'description' => 'The color value',
'type' => 'varchar',
'length' => $color_length,
'not null' => FALSE,
],
'opacity' => [
'description' => 'The opacity/alphavalue property',
'type' => 'float',
'size' => 'tiny',
'not null' => FALSE,
],
],
'indexes' => [
'color' => [
'color',
],
],
];
}