Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / views / src / Plugin / views / display / DisplayRouterInterface.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\display;
4
5 use Symfony\Component\Routing\RouteCollection;
6
7 /**
8  * Defines an interface for displays that can collect routes.
9  *
10  * In addition to implementing the interface, specify 'uses_routes' in the
11  * plugin definition.
12  */
13 interface DisplayRouterInterface extends DisplayPluginInterface {
14
15   /**
16    * Adds the route entry of a view to the collection.
17    *
18    * @param \Symfony\Component\Routing\RouteCollection $collection
19    *   A collection of routes that should be registered for this resource.
20    */
21   public function collectRoutes(RouteCollection $collection);
22
23   /**
24    * Alters a collection of routes and replaces definitions to the view.
25    *
26    * Most of the collections won't have the needed route, so by the return value
27    * the method can specify to break the search.
28    *
29    * @param \Symfony\Component\Routing\RouteCollection $collection
30    *
31    * @return array
32    *   Returns a list of "$view_id.$display_id" elements which got overridden.
33    */
34   public function alterRoutes(RouteCollection $collection);
35
36   /**
37    * Generates a URL to this display.
38    *
39    * @return \Drupal\Core\Url
40    *   A URL object for the display.
41    */
42   public function getUrlInfo();
43
44   /**
45    * Returns the route name for the display.
46    *
47    * The default route name for a display is views.$view_id.$display_id. Some
48    * displays may override existing routes; in these cases, the route that is
49    * overridden is returned instead.
50    *
51    * @return string
52    *   The name of the route
53    *
54    * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
55    * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::getAlteredRouteNames()
56    */
57   public function getRouteName();
58
59   /**
60    * Returns the list of routes overridden by Views.
61    *
62    * @return string[]
63    *   An array of overridden route names. The keys are in the form
64    *   view_id.display_id and the values are the route names.
65    *
66    * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
67    */
68   public function getAlteredRouteNames();
69
70 }