You are here

public static function GridFieldType::generateSampleValue in Paragraphs grid 8

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

src/Plugin/Field/FieldType/GridFieldType.php, line 154

Class

GridFieldType
Plugin implementation of the 'grid_field_type' field type.

Namespace

Drupal\paragraphs_grid\Plugin\Field\FieldType

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
  $random = new Random();
  $values['value'] = $random
    ->word(mt_rand(1, 511));
  $values['view_mode'] = $random
    ->word(mt_rand(1, 63));
  return $values;
}