public static function StatusItem::generateSampleValue in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/StatusItem.php \Drupal\user\StatusItem::generateSampleValue()
- 9 core/modules/user/src/StatusItem.php \Drupal\user\StatusItem::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 BooleanItem::generateSampleValue
File
- core/
modules/ user/ src/ StatusItem.php, line 19
Class
- StatusItem
- Defines the 'status' entity field type.
Namespace
Drupal\userCode
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
// Always generate a sample with an enabled status.
$values['value'] = 1;
return $values;
}