03aaa2f472253c3228f2a614b731c78f7147b54b
[yaffs-website] / web / modules / contrib / metatag / src / MetatagManagerInterface.php
1 <?php
2
3 namespace Drupal\metatag;
4
5 use Drupal\Core\Entity\ContentEntityInterface;
6
7 /**
8  * Class MetatagManager.
9  *
10  * @package Drupal\metatag
11  */
12 interface MetatagManagerInterface {
13
14   /**
15    * Extracts all tags of a given entity.
16    *
17    * @param \Drupal\Core\Entity\ContentEntityInterface $entity
18    *   The content entity to extract metatags from.
19    *
20    * @return array
21    *   Array of metatags.
22    */
23   public function tagsFromEntity(ContentEntityInterface $entity);
24
25   /**
26    * Returns an array of group plugin information sorted by weight.
27    *
28    * @return array
29    *   Array of groups, sorted by weight.
30    */
31   public function sortedGroups();
32
33   /**
34    * Returns an array of tag plugin information sorted by group then weight.
35    *
36    * @return array
37    *   Array of tags, sorted by weight.
38    */
39   public function sortedTags();
40
41   /**
42    * Returns a weighted array of groups containing their weighted tags.
43    *
44    * @return array
45    *   Array of sorted tags, in groups.
46    */
47   public function sortedGroupsWithTags();
48
49   /**
50    * Builds the form element for a Metatag field.
51    *
52    * If a list of either groups or tags are passed in, those will be used to
53    * limit the groups/tags on the form. If nothing is passed in, all groups
54    * and tags will be used.
55    *
56    * @param array $values
57    *   Existing values.
58    * @param array $element
59    *   Existing element
60    * @param mixed $token_types
61    *   Token types to return in the tree.
62    * @param array $included_groups
63    *   Available group plugins.
64    * @param array $included_tags
65    *   Available tag plugins.
66    *
67    * @return array
68    *   Render array for metatag form.
69    */
70   public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL);
71
72 }