function EmailItem::generateSampleValue

Overrides FieldItemBase::generateSampleValue

1 call to EmailItem::generateSampleValue()
EntityUser::processStubRow in core/modules/user/src/Plugin/migrate/destination/EntityUser.php
Populates as much of the stub row as possible.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php, line 76

Class

EmailItem
Defines the 'email' field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
  $random = new Random();
  $values['value'] = $random->name() . '@example.com';
  return $values;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.