Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / metatag / src / MetatagManagerInterface.php
1 <?php
2
3 namespace Drupal\metatag;
4
5 use Drupal\Core\Entity\ContentEntityInterface;
6 use Drupal\views\ViewEntityInterface;
7
8 /**
9  * Class MetatagManager.
10  *
11  * @package Drupal\metatag
12  */
13 interface MetatagManagerInterface {
14
15   /**
16    * Extracts all tags of a given entity.
17    *
18    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
19    *   The content entity to extract metatags from.
20    *
21    * @return array
22    *   Array of metatags.
23    */
24   public function tagsFromEntity(ContentEntityInterface $entity);
25
26   /**
27    * Extracts all tags of a given entity, and combines them with sitewide,
28    * per-entity-type, and per-bundle defaults.
29    *
30    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
31    *   The content entity to extract metatags from.
32    *
33    * @return array
34    *   Array of metatags.
35    */
36   public function tagsFromEntityWithDefaults(ContentEntityInterface $entity);
37
38   /**
39    * Extracts all appropriate default tags for an entity, from sitewide,
40    * per-entity-type, and per-bundle defaults.
41    *
42    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
43    *   The content entity for which to calculate defaults.
44    *
45    * @return array
46    *   Array of metatags.
47    */
48   public function defaultTagsFromEntity(ContentEntityInterface $entity);
49
50   /**
51    * Returns an array of group plugin information sorted by weight.
52    *
53    * @return array
54    *   Array of groups, sorted by weight.
55    */
56   public function sortedGroups();
57
58   /**
59    * Returns an array of tag plugin information sorted by group then weight.
60    *
61    * @return array
62    *   Array of tags, sorted by weight.
63    */
64   public function sortedTags();
65
66   /**
67    * Returns a weighted array of groups containing their weighted tags.
68    *
69    * @return array
70    *   Array of sorted tags, in groups.
71    */
72   public function sortedGroupsWithTags();
73
74   /**
75    * Builds the form element for a Metatag field.
76    *
77    * If a list of either groups or tags are passed in, those will be used to
78    * limit the groups/tags on the form. If nothing is passed in, all groups
79    * and tags will be used.
80    *
81    * @param array $values
82    *   Existing values.
83    * @param array $element
84    *   Existing element
85    * @param mixed $token_types
86    *   Token types to return in the tree.
87    * @param array $included_groups
88    *   Available group plugins.
89    * @param array $included_tags
90    *   Available tag plugins.
91    *
92    * @return array
93    *   Render array for metatag form.
94    */
95   public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL);
96
97 }