PagedRouteProviderInterface.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * This file is part of the Symfony CMF package.
  4. *
  5. * (c) 2011-2014 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. /**
  12. * Interface for a provider which allows to retrieve a limited amount of routes.
  13. */
  14. interface PagedRouteProviderInterface extends RouteProviderInterface
  15. {
  16. /**
  17. * Find an amount of routes with an offset and possible a limit.
  18. *
  19. * In case you want to iterate over all routes, you want to avoid to load
  20. * all routes at once.
  21. *
  22. * @param int $offset
  23. * The sequence will start with that offset in the list of all routes.
  24. * @param int $length [optional]
  25. * The sequence will have that many routes in it. If no length is
  26. * specified all routes are returned.
  27. *
  28. * @return \Symfony\Component\Routing\Route[]
  29. * Routes keyed by the route name.
  30. */
  31. public function getRoutesPaged($offset, $length = null);
  32. /**
  33. * Determines the total amount of routes.
  34. *
  35. * @return int
  36. */
  37. public function getRoutesCount();
  38. }