function FieldItemInterface::generateSampleValue

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldItemInterface.php \Drupal\Core\Field\FieldItemInterface::generateSampleValue()
  2. 8.9.x core/lib/Drupal/Core/Field/FieldItemInterface.php \Drupal\Core\Field\FieldItemInterface::generateSampleValue()
  3. 10 core/lib/Drupal/Core/Field/FieldItemInterface.php \Drupal\Core\Field\FieldItemInterface::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.

1 method overrides FieldItemInterface::generateSampleValue()
FieldItemBase::generateSampleValue in core/lib/Drupal/Core/Field/FieldItemBase.php

File

core/lib/Drupal/Core/Field/FieldItemInterface.php, line 247

Class

FieldItemInterface
Interface for entity field items.

Namespace

Drupal\Core\Field

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.