You are here

public static function StatusItem::generateSampleValue in Drupal 8

Same name and namespace in other branches
  1. 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\user

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {

  // Always generate a sample with an enabled status.
  $values['value'] = 1;
  return $values;
}