You are here

public static function FieldItemBase::generateSampleValue in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldItemBase.php \Drupal\Core\Field\FieldItemBase::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 FieldItemInterface::generateSampleValue

18 methods override FieldItemBase::generateSampleValue()
BooleanItem::generateSampleValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
Generates placeholder field values.
CommentItem::generateSampleValue in core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
Generates placeholder field values.
DateTimeItem::generateSampleValue in core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
Generates placeholder field values.
DecimalItem::generateSampleValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
Generates placeholder field values.
EmailItem::generateSampleValue in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php
Generates placeholder field values.

... See full list

File

core/lib/Drupal/Core/Field/FieldItemBase.php, line 209

Class

FieldItemBase
An entity field item.

Namespace

Drupal\Core\Field

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
}