public static function ShapeItem::propertyDefinitions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php \Drupal\entity_test\Plugin\Field\FieldType\ShapeItem::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
1 call to ShapeItem::propertyDefinitions()
- ShapeItemRequired::propertyDefinitions in core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Field/ FieldType/ ShapeItemRequired.php - Defines field item properties.
1 method overrides ShapeItem::propertyDefinitions()
- ShapeItemRequired::propertyDefinitions in core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Field/ FieldType/ ShapeItemRequired.php - Defines field item properties.
File
- core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Field/ FieldType/ ShapeItem.php, line 37 - Contains \Drupal\entity_test\Plugin\Field\FieldType\ShapeItem.
Class
- ShapeItem
- Defines the 'shape' field type.
Namespace
Drupal\entity_test\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['shape'] = DataDefinition::create('string')
->setLabel(t('Shape'));
$properties['color'] = DataDefinition::create('string')
->setLabel(t('Color'));
return $properties;
}