You are here

public static function LanguageKeyValueItem::propertyDefinitions in Lingotek Translation 4.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  2. 8.2 src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  3. 3.0.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  4. 3.1.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  5. 3.2.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  6. 3.3.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  7. 3.4.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  8. 3.5.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  9. 3.6.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  10. 3.7.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::propertyDefinitions()
  11. 3.8.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::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 StringItemBase::propertyDefinitions

See also

\Drupal\Core\Field\BaseFieldDefinition

File

src/Plugin/Field/FieldType/LanguageKeyValueItem.php, line 48

Class

LanguageKeyValueItem
Plugin implementation of the 'language_key_value' field type.

Namespace

Drupal\lingotek\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);
  $properties['language'] = DataDefinition::create('string')
    ->setLabel(new TranslatableMarkup('Language Key'))
    ->setRequired(TRUE);
  return $properties;
}