public static function PriceModifiedItem::propertyDefinitions in Price 8
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldType/PriceModifiedItem.php \Drupal\price\Plugin\Field\FieldType\PriceModifiedItem::propertyDefinitions()
- 3.0.x src/Plugin/Field/FieldType/PriceModifiedItem.php \Drupal\price\Plugin\Field\FieldType\PriceModifiedItem::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 PriceItem::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
Plugin/ Field/ FieldType/ PriceModifiedItem.php, line 28
Class
- PriceModifiedItem
- Plugin implementation of the 'modified price' field type.
Namespace
Drupal\price\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['modifier'] = DataDefinition::create('string')
->setLabel(t('Modifier'))
->setRequired(FALSE);
return $properties;
}