public static function LanguageKeyValueItem::generateSampleValue in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 8.2 src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 4.0.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.0.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.1.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.2.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.3.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.4.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.5.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.7.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
- 3.8.x src/Plugin/Field/FieldType/LanguageKeyValueItem.php \Drupal\lingotek\Plugin\Field\FieldType\LanguageKeyValueItem::generateSampleValue()
Generates placeholder field values.
Useful when populating site with placeholder content during site building or profiling.
Parameters
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.
Return value
array An associative array of values.
Overrides StringItem::generateSampleValue
File
- src/
Plugin/ Field/ FieldType/ LanguageKeyValueItem.php, line 59
Class
- LanguageKeyValueItem
- Plugin implementation of the 'language_key_value' field type.
Namespace
Drupal\lingotek\Plugin\Field\FieldTypeCode
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
$value = parent::generateSampleValue($field_definition);
// ToDo: This should be really random.
$value['language'] = self::getLangcode();
return $value;
}