public static function StringItemBase::propertyDefinitions in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php \Drupal\Core\Field\Plugin\Field\FieldType\StringItemBase::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
2 methods override StringItemBase::propertyDefinitions()
- PasswordItem::propertyDefinitions in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ PasswordItem.php - Defines field item properties.
- UriItem::propertyDefinitions in core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ UriItem.php - Defines field item properties.
File
- core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ StringItemBase.php, line 32 - Contains \Drupal\Core\Field\Plugin\Field\FieldType\StringItemBase.
Class
- StringItemBase
- Base class for string field types.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
// This is called very early by the user entity roles field. Prevent
// early t() calls by using the TranslatableMarkup.
$properties['value'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Text value'))
->setSetting('case_sensitive', $field_definition
->getSetting('case_sensitive'))
->setRequired(TRUE);
return $properties;
}