You are here

interface TokenEntityMapperInterface in Token 8

Hierarchy

Expanded class hierarchy of TokenEntityMapperInterface

All classes that implement TokenEntityMapperInterface

1 file declares its use of TokenEntityMapperInterface
TokenDevelController.php in src/Controller/TokenDevelController.php

File

src/TokenEntityMapperInterface.php, line 5

Namespace

Drupal\token
View source
interface TokenEntityMapperInterface {

  /**
   * Return an array of entity type to token type mappings.
   *
   * @return array
   *   An array of mappings with entity type mapping to token type.
   */
  public function getEntityTypeMappings();

  /**
   * Return the entity type of a particular token type.
   *
   * @param string $token_type
   *   The token type for which the mapping is returned.
   * @param bool $fallback
   *   (optional) Defaults to FALSE. If true, the same $value is returned in
   *   case the mapping was not found.
   *
   * @return string
   *   The entity type of the token type specified.
   *
   * @see token_entity_info_alter()
   * @see http://drupal.org/node/737726
   */
  function getEntityTypeForTokenType($token_type, $fallback = FALSE);

  /**
   * Return the token type of a particular entity type.
   *
   * @param string $entity_type
   *   The entity type for which the mapping is returned.
   * @param bool $fallback
   *   (optional) Defaults to FALSE. If true, the same $value is returned in
   *   case the mapping was not found.
   *
   * @return string
   *   The token type of the entity type specified.
   *
   * @see token_entity_info_alter()
   * @see http://drupal.org/node/737726
   */
  function getTokenTypeForEntityType($entity_type, $fallback = FALSE);

  /**
   * Resets metadata describing token and entity mappings.
   */
  public function resetInfo();

}

Members

Namesort descending Modifiers Type Description Overrides
TokenEntityMapperInterface::getEntityTypeForTokenType function Return the entity type of a particular token type. 1
TokenEntityMapperInterface::getEntityTypeMappings public function Return an array of entity type to token type mappings. 1
TokenEntityMapperInterface::getTokenTypeForEntityType function Return the token type of a particular entity type. 1
TokenEntityMapperInterface::resetInfo public function Resets metadata describing token and entity mappings. 1