Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Menu / ContextualLinkManagerInterface.php
1 <?php
2
3 namespace Drupal\Core\Menu;
4
5 /**
6  * Provides an object which returns the available contextual links.
7  */
8 interface ContextualLinkManagerInterface {
9
10   /**
11    * Gets the contextual link plugins by contextual link group.
12    *
13    * @param string $group_name
14    *   The group name.
15    *
16    * @return array
17    *   A list of contextual links plugin definitions.
18    */
19   public function getContextualLinkPluginsByGroup($group_name);
20
21   /**
22    * Gets the contextual links prepared as expected by links.html.twig.
23    *
24    * @param string $group_name
25    *   The group name.
26    * @param array $route_parameters
27    *   The incoming route parameters. The route parameters need to have the same
28    *   name on all contextual link routes, e.g. you cannot use 'node' and
29    *   'entity' in parallel.
30    * @param array $metadata
31    *   Additional metadata of contextual links, like the position (optional).
32    *
33    * @return array
34    *   An array of link information, keyed by the plugin ID. Each entry is an
35    *   associative array with the following keys:
36    *     - route_name: The route name to link to.
37    *     - route_parameters: The route parameters for the contextual link.
38    *     - title: The title of the contextual link.
39    *     - weight: The weight of the contextual link.
40    *     - localized_options: The options of the link, which will be passed
41    *       to the link generator.
42    *     - metadata: The array of additional metadata that was passed in.
43    */
44   public function getContextualLinksArrayByGroup($group_name, array $route_parameters, array $metadata = []);
45
46 }