You are here

public static function PriceModifiedItem::propertyDefinitions in Price 3.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/PriceModifiedItem.php \Drupal\price\Plugin\Field\FieldType\PriceModifiedItem::propertyDefinitions()
  2. 3.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\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);
  $properties['modifier'] = DataDefinition::create('string')
    ->setLabel(t('Modifier'))
    ->setRequired(FALSE);
  return $properties;
}