You are here

public static function LayoutSectionItem::generateSampleValue in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php \Drupal\layout_builder\Plugin\Field\FieldType\LayoutSectionItem::generateSampleValue()
  2. 10 core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php \Drupal\layout_builder\Plugin\Field\FieldType\LayoutSectionItem::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 FieldItemBase::generateSampleValue

File

core/modules/layout_builder/src/Plugin/Field/FieldType/LayoutSectionItem.php, line 82

Class

LayoutSectionItem
Plugin implementation of the 'layout_section' field type.

Namespace

Drupal\layout_builder\Plugin\Field\FieldType

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {

  // @todo Expand this in https://www.drupal.org/node/2912331.
  $values['section'] = new Section('layout_onecol');
  return $values;
}