Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Routing / RouteConverterInterface.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader\Routing;
4
5 use Drupal\drupalmoduleupgrader\Routing\Drupal7\RouteWrapper;
6 use Drupal\drupalmoduleupgrader\TargetInterface;
7
8 /**
9  * Defines a route converter, which converts a Drupal 7 router item to a
10  * Drupal 8 Symfony route. These plugins are NOT responsible for converting
11  * *links* (including tabs or local actions), only the actual route.
12  *
13  * Every method in this interface takes two arguments. First, a TargetInterface
14  * representing the target module. Second, the original Drupal 7 route (i.e.,
15  * hook_menu() item), wrapped in a RouteWrapperInterface.
16  */
17 interface RouteConverterInterface {
18
19   /**
20    * Generates the route's machine-readable name.
21    *
22    * @return string
23    */
24   public function getName(TargetInterface $target, RouteWrapper $route);
25
26   /**
27    * Builds the Drupal 8 path for the route.
28    *
29    * The path should be prefixed by a slash, and contain {slugs} corresponding
30    * to parameters of the callback method which can accept input from the path.
31    * Parameters are matched to slugs by name and type hint.
32    *
33    * @return \Drupal\drupalmoduleupgrader\Utility\Path\PathUtilityInterface
34    */
35   public function buildPath(TargetInterface $target, RouteWrapper $route);
36
37   /**
38    * Builds the Drupal 8 definition for the route, without making any changes
39    * to the original module or callback.
40    *
41    * @return Drupal8\RouteWrapper
42    */
43   public function buildRouteDefinition(TargetInterface $target, RouteWrapper $route);
44
45   /**
46    * Builds the Drupal 8 route, making any needed changes to the original module
47    * and/or callback.
48    */
49   public function buildRoute(TargetInterface $target, RouteWrapper $route);
50
51 }