TourInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Drupal\tour;
  3. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  4. /**
  5. * Provides an interface defining a tour entity.
  6. */
  7. interface TourInterface extends ConfigEntityInterface {
  8. /**
  9. * The routes that this tour will appear on.
  10. *
  11. * @return array
  12. * Returns array of routes for the tour.
  13. */
  14. public function getRoutes();
  15. /**
  16. * Whether the tour matches a given set of route parameters.
  17. *
  18. * @param string $route_name
  19. * The route name the parameters are for.
  20. * @param array $route_params
  21. * Associative array of raw route params.
  22. *
  23. * @return bool
  24. * TRUE if the tour matches the route parameters.
  25. */
  26. public function hasMatchingRoute($route_name, $route_params);
  27. /**
  28. * Returns tip plugin.
  29. *
  30. * @param string $id
  31. * The identifier of the tip.
  32. *
  33. * @return \Drupal\tour\TipPluginInterface
  34. * The tip plugin.
  35. */
  36. public function getTip($id);
  37. /**
  38. * Returns the tips for this tour.
  39. *
  40. * @return array
  41. * An array of tip plugins.
  42. */
  43. public function getTips();
  44. /**
  45. * Gets the module this tour belongs to.
  46. *
  47. * @return string
  48. * The module this tour belongs to.
  49. */
  50. public function getModule();
  51. /**
  52. * Resets the statically cached keyed routes.
  53. */
  54. public function resetKeyedRoutes();
  55. }