You are here

interface FormatWordingInterface in Synonyms 2.0.x

Interface to format a synonym into some kind of wording.

Hierarchy

Expanded class hierarchy of FormatWordingInterface

All classes that implement FormatWordingInterface

1 file declares its use of FormatWordingInterface
AbstractProvider.php in src/Plugin/Synonyms/Provider/AbstractProvider.php

File

src/ProviderInterface/FormatWordingInterface.php, line 11

Namespace

Drupal\synonyms\ProviderInterface
View source
interface FormatWordingInterface {

  /**
   * Format a synonym into wording as requested by configuration.
   *
   * @param string $synonym
   *   Synonym that should be formatted.
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   Entity to which this synonym belongs.
   * @param \Drupal\synonyms\SynonymInterface $synonym_config
   *   Synonym config entity in the context of which it all happens.
   * @param string $service_id
   *   The caller widget's service id.
   *
   * @return string
   *   Formatted wording
   */
  public function synonymFormatWording($synonym, ContentEntityInterface $entity, SynonymInterface $synonym_config, $service_id);

  /**
   * Get available tokens for format wording.
   *
   * @return array
   *   Array of supported tokens in wording. Keys are the tokens whereas
   *   corresponding values are explanations about what each token means
   */
  public function formatWordingAvailableTokens();

}

Members

Namesort descending Modifiers Type Description Overrides
FormatWordingInterface::formatWordingAvailableTokens public function Get available tokens for format wording.
FormatWordingInterface::synonymFormatWording public function Format a synonym into wording as requested by configuration.