public static function FontFieldIcon::propertyDefinitions in Font Field Icon 8
Defines field item properties.
Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().
Return value
\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.
Overrides FieldItemInterface::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
Plugin/ Field/ FieldType/ FontFieldIcon.php, line 26
Class
- FontFieldIcon
- Plugin implementation of the 'font_field_icon' field type.
Namespace
Drupal\font_field_icon\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(StorageDefinition $storage) {
$properties = [];
$properties['font_field_icon'] = DataDefinition::create('string')
->setLabel(t('Icon for field'));
$properties['font_field_icon_link'] = DataDefinition::create('string')
->setLabel(t('Text in field'));
return $properties;
}