public static function PathItem::generateSampleValue in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/path/src/Plugin/Field/FieldType/PathItem.php \Drupal\path\Plugin\Field\FieldType\PathItem::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/ path/ src/ Plugin/ Field/ FieldType/ PathItem.php, line 92 - Contains \Drupal\path\Plugin\Field\FieldType\PathItem.
Class
- PathItem
- Defines the 'path' entity field type.
Namespace
Drupal\path\Plugin\Field\FieldTypeCode
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
$random = new Random();
$values['alias'] = str_replace(' ', '-', strtolower($random
->sentences(3)));
return $values;
}