3 namespace Drupal\token;
5 interface TokenEntityMapperInterface {
8 * Return an array of entity type to token type mappings.
11 * An array of mappings with entity type mapping to token type.
13 public function getEntityTypeMappings();
16 * Return the entity type of a particular token type.
18 * @param string $token_type
19 * The token type for which the mapping is returned.
20 * @param bool $fallback
21 * (optional) Defaults to FALSE. If true, the same $value is returned in
22 * case the mapping was not found.
25 * The entity type of the token type specified.
27 * @see token_entity_info_alter()
28 * @see http://drupal.org/node/737726
30 function getEntityTypeForTokenType($token_type, $fallback = FALSE);
33 * Return the token type of a particular entity type.
35 * @param string $entity_type
36 * The entity type for which the mapping is returned.
37 * @param bool $fallback
38 * (optional) Defaults to FALSE. If true, the same $value is returned in
39 * case the mapping was not found.
42 * The token type of the entity type specified.
44 * @see token_entity_info_alter()
45 * @see http://drupal.org/node/737726
47 function getTokenTypeForEntityType($entity_type, $fallback = FALSE);
50 * Resets metadata describing token and entity mappings.
52 public function resetInfo();