RouteBuilderInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Drupal\Core\Routing;
  3. /**
  4. * Rebuilds the route information and dumps it.
  5. *
  6. * Rebuilding the route information is the process of gathering all routing data
  7. * from .routing.yml files, creating a
  8. * \Symfony\Component\Routing\RouteCollection object out of it, and dispatching
  9. * that object as a \Drupal\Core\Routing\RouteBuildEvent to all registered
  10. * listeners. After that, the \Symfony\Component\Routing\RouteCollection object
  11. * is used to dump the data. Examples of a dump include filling up the routing
  12. * table, auto-generating Apache mod_rewrite rules, or auto-generating a PHP
  13. * matcher class.
  14. *
  15. * @see \Drupal\Core\Routing\MatcherDumperInterface
  16. * @see \Drupal\Core\Routing\RouteProviderInterface
  17. *
  18. * @ingroup routing
  19. */
  20. interface RouteBuilderInterface {
  21. /**
  22. * Rebuilds the route information and dumps it.
  23. *
  24. * @return bool
  25. * Returns TRUE if the rebuild succeeds, FALSE otherwise.
  26. */
  27. public function rebuild();
  28. /**
  29. * Rebuilds the route information if necessary, and dumps it.
  30. *
  31. * @return bool
  32. * Returns TRUE if the rebuild occurs, FALSE otherwise.
  33. */
  34. public function rebuildIfNeeded();
  35. /**
  36. * Sets the router to be rebuilt next time rebuildIfNeeded() is called.
  37. */
  38. public function setRebuildNeeded();
  39. }