RouteGeneratorInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Route;
  11. use Sonata\AdminBundle\Admin\AdminInterface;
  12. /**
  13. * Interface RouteGeneratorInterface.
  14. *
  15. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  16. */
  17. interface RouteGeneratorInterface
  18. {
  19. /**
  20. * @param AdminInterface $admin
  21. * @param string $name
  22. * @param array $parameters
  23. * @param bool $absolute
  24. *
  25. * @return string
  26. */
  27. public function generateUrl(AdminInterface $admin, $name, array $parameters = array(), $absolute = false);
  28. /**
  29. * @param AdminInterface $admin
  30. * @param string $name
  31. * @param array $parameters
  32. * @param bool $absolute
  33. *
  34. * @return array
  35. */
  36. public function generateMenuUrl(AdminInterface $admin, $name, array $parameters = array(), $absolute = false);
  37. /**
  38. * @param string $name
  39. * @param array $parameters
  40. * @param bool $absolute
  41. *
  42. * @return string
  43. */
  44. public function generate($name, array $parameters = array(), $absolute = false);
  45. /**
  46. * @param AdminInterface $admin
  47. * @param string $name
  48. *
  49. * @return bool
  50. */
  51. public function hasAdminRoute(AdminInterface $admin, $name);
  52. }