interface NameGeneratorInterface in Name Field 8
Provides an interface for the various functions required for the examples.
Hierarchy
- interface \Drupal\name\NameGeneratorInterface
Expanded class hierarchy of NameGeneratorInterface
All classes that implement NameGeneratorInterface
1 file declares its use of NameGeneratorInterface
- NameFormatter.php in src/
Plugin/ Field/ FieldFormatter/ NameFormatter.php
File
- src/
NameGeneratorInterface.php, line 10
Namespace
Drupal\nameView source
interface NameGeneratorInterface {
/**
* Service to generate random names.
*
* @param int $limit
* The number to generate.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition if in context.
*
* @return array
* An array of name components.
*/
public function generateSampleNames($limit = 3, FieldDefinitionInterface $field_definition = NULL);
/**
* Service to load preconfigured names.
*
* @param int $limit
* The number to load.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition if in context.
*
* @return array
* An array of name components.
*/
public function loadSampleValues($limit = 3, FieldDefinitionInterface $field_definition = NULL);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NameGeneratorInterface:: |
public | function | Service to generate random names. | 1 |
NameGeneratorInterface:: |
public | function | Service to load preconfigured names. | 1 |