You are here

interface SynonymsGetProviderInterface in Synonyms 8

Interface to extract (get) synonyms from an entity.

Hierarchy

Expanded class hierarchy of SynonymsGetProviderInterface

All classes that implement SynonymsGetProviderInterface

3 files declare their use of SynonymsGetProviderInterface
BaseField.php in src/Plugin/Synonyms/Provider/BaseField.php
EntityReferenceField.php in src/Plugin/Synonyms/Provider/EntityReferenceField.php
Field.php in src/Plugin/Synonyms/Provider/Field.php

File

src/SynonymsProviderInterface/SynonymsGetProviderInterface.php, line 10

Namespace

Drupal\synonyms\SynonymsProviderInterface
View source
interface SynonymsGetProviderInterface extends SynonymsProviderInterface {

  /**
   * Fetch synonyms from an entity.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   Entity whose synonyms should be fetched.
   *
   * @return string[]
   *   Array of extracted synonyms
   */
  public function getSynonyms(ContentEntityInterface $entity);

  /**
   * Fetch synonyms from multiple entities at once.
   *
   * @param array $entities
   *   Array of entities whose synonyms should be fetched. The array will be
   *   keyed by entity ID and all provided entities will be of the same entity
   *   type and bundle.
   *
   * @return array
   *   Array of extracted synonyms. It must be keyed by entity ID and each sub
   *   array should represent a list of synonyms that were extracted from the
   *   corresponding entity
   */
  public function getSynonymsMultiple(array $entities);

}

Members

Namesort descending Modifiers Type Description Overrides
SynonymsGetProviderInterface::getSynonyms public function Fetch synonyms from an entity.
SynonymsGetProviderInterface::getSynonymsMultiple public function Fetch synonyms from multiple entities at once.
SynonymsProviderInterface::getBehaviorService public function Fetch behavior service which corresponds to this provider. 1
SynonymsProviderInterface::getBehaviorServiceInstance public function Fetch behavior service instance which corresponds to this provider. 1