public static function IconFieldItem::propertyDefinitions in Icon API 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
- modules/
icon_field/ src/ Plugin/ Field/ FieldType/ IconFieldItem.php, line 31 - Contains \Drupal\Icon\Plugin\field\field_type\IconFieldItem.
Class
- IconFieldItem
- Plugin implementation of the 'IconFieldItem' field type.
Namespace
Drupal\icon_field\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['icon'] = DataDefinition::create('string')
->setLabel(t('Icon'))
->setRequired(TRUE);
return $properties;
}