Same name and namespace in other branches
- 3.0.x src/Plugin/Field/FieldType/ColorFieldType.php \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType::propertyDefinitions()
Fichier
-
src/
Plugin/ Field/ FieldType/ ColorFieldType.php, line 120
Classe
- ColorFieldType
- Plugin implementation of the 'color_type' field type.
Namespace
Drupal\color_field\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
// Prevent early t() calls by using the TranslatableMarkup.
$properties['color'] = DataDefinition::create('string')->setLabel(new TranslatableMarkup('Color'));
$properties['opacity'] = DataDefinition::create('float')->setLabel(new TranslatableMarkup('Opacity'));
return $properties;
}