Style changes for the Use cases.
[yaffs-website] / web / modules / contrib / token / src / TokenEntityMapperInterface.php
1 <?php
2
3 namespace Drupal\token;
4
5 interface TokenEntityMapperInterface {
6
7   /**
8    * Return an array of entity type to token type mappings.
9    *
10    * @return array
11    *   An array of mappings with entity type mapping to token type.
12    */
13   public function getEntityTypeMappings();
14
15   /**
16    * Return the entity type of a particular token type.
17    *
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.
23    *
24    * @return string
25    *   The entity type of the token type specified.
26    *
27    * @see token_entity_info_alter()
28    * @see http://drupal.org/node/737726
29    */
30   function getEntityTypeForTokenType($token_type, $fallback = FALSE);
31
32   /**
33    * Return the token type of a particular entity type.
34    *
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.
40    *
41    * @return string
42    *   The token type of the entity type specified.
43    *
44    * @see token_entity_info_alter()
45    * @see http://drupal.org/node/737726
46    */
47   function getTokenTypeForEntityType($entity_type, $fallback = FALSE);
48
49   /**
50    * Resets metadata describing token and entity mappings.
51    */
52   public function resetInfo();
53 }