You are here

interface NameGeneratorInterface in Name Field 8

Provides an interface for the various functions required for the examples.

Hierarchy

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\name
View 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

Namesort descending Modifiers Type Description Overrides
NameGeneratorInterface::generateSampleNames public function Service to generate random names. 1
NameGeneratorInterface::loadSampleValues public function Service to load preconfigured names. 1