public static function ChartConfigItem::propertyDefinitions in Charts 5.0.x
Same name and namespace in other branches
- 8.4 src/Plugin/Field/FieldType/ChartConfigItem.php \Drupal\charts\Plugin\Field\FieldType\ChartConfigItem::propertyDefinitions()
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/ ChartConfigItem.php, line 26
Class
- ChartConfigItem
- Plugin implementation of the 'chart_config' field type.
Namespace
Drupal\charts\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['config'] = DataDefinition::create('chart_config')
->setLabel(new TranslatableMarkup('Chart configuration'))
->setRequired(TRUE);
$properties['library'] = DataDefinition::create('string')
->setLabel(t('Chart library'));
$properties['type'] = DataDefinition::create('string')
->setLabel(t('Chart type'));
return $properties;
}