3 namespace Drupal\metatag;
5 use Drupal\Core\Entity\ContentEntityInterface;
8 * Class MetatagManager.
10 * @package Drupal\metatag
12 interface MetatagManagerInterface {
15 * Extracts all tags of a given entity.
17 * @param \Drupal\Core\Entity\ContentEntityInterface $entity
18 * The content entity to extract metatags from.
23 public function tagsFromEntity(ContentEntityInterface $entity);
26 * Returns an array of group plugin information sorted by weight.
29 * Array of groups, sorted by weight.
31 public function sortedGroups();
34 * Returns an array of tag plugin information sorted by group then weight.
37 * Array of tags, sorted by weight.
39 public function sortedTags();
42 * Returns a weighted array of groups containing their weighted tags.
45 * Array of sorted tags, in groups.
47 public function sortedGroupsWithTags();
50 * Builds the form element for a Metatag field.
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.
56 * @param array $values
58 * @param array $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.
68 * Render array for metatag form.
70 public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL);