You are here

public static function PhoneInternational::generateSampleValue in International Phone 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/PhoneInternational.php \Drupal\phone_international\Plugin\Field\FieldType\PhoneInternational::generateSampleValue()
  2. 3.x src/Plugin/Field/FieldType/PhoneInternational.php \Drupal\phone_international\Plugin\Field\FieldType\PhoneInternational::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

src/Plugin/Field/FieldType/PhoneInternational.php, line 54

Class

PhoneInternational
Plugin implementation of the 'phone_international' field type.

Namespace

Drupal\phone_international\Plugin\Field\FieldType

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
  $values['value'] = rand(pow(10, 8), pow(10, 9) - 1);
  return $values;
}