public static function FileLinkItem::generateSampleValue in File Link 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Field/FieldType/FileLinkItem.php \Drupal\file_link\Plugin\Field\FieldType\FileLinkItem::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 LinkItem::generateSampleValue
File
- src/
Plugin/ Field/ FieldType/ FileLinkItem.php, line 139
Class
- FileLinkItem
- Implements a 'file_link' plugin field type.
Namespace
Drupal\file_link\Plugin\Field\FieldTypeCode
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
$values = parent::generateSampleValue($field_definition);
$values['size'] = 1234567;
$values['format'] = 'image/png';
return $values;
}