VersatileGeneratorInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of the Symfony CMF package.
  4. *
  5. * (c) 2011-2015 Symfony CMF
  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 Symfony\Cmf\Component\Routing;
  11. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  12. /**
  13. * This generator is able to handle more than string route names as symfony
  14. * core supports them.
  15. */
  16. interface VersatileGeneratorInterface extends UrlGeneratorInterface
  17. {
  18. /**
  19. * Whether this generator supports the supplied $name.
  20. *
  21. * This check does not need to look if the specific instance can be
  22. * resolved to a route, only whether the router can generate routes from
  23. * objects of this class.
  24. *
  25. * @param mixed $name The route "name" which may also be an object or anything
  26. *
  27. * @return bool
  28. */
  29. public function supports($name);
  30. /**
  31. * Convert a route identifier (name, content object etc) into a string
  32. * usable for logging and other debug/error messages.
  33. *
  34. * @param mixed $name
  35. * @param array $parameters which should contain a content field containing
  36. * a RouteReferrersReadInterface object
  37. *
  38. * @return string
  39. */
  40. public function getRouteDebugMessage($name, array $parameters = array());
  41. }