StringLongItem.php in Drupal 10
File
core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
View source
<?php
namespace Drupal\Core\Field\Plugin\Field\FieldType;
use Drupal\Component\Utility\Random;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
class StringLongItem extends StringItemBase {
public static function schema(FieldStorageDefinitionInterface $field_definition) {
return [
'columns' => [
'value' => [
'type' => $field_definition
->getSetting('case_sensitive') ? 'blob' : 'text',
'size' => 'big',
],
],
];
}
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
$random = new Random();
$values['value'] = $random
->paragraphs();
return $values;
}
}