PagerInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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\Datagrid;
  11. /**
  12. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  13. */
  14. interface PagerInterface
  15. {
  16. /**
  17. * Initialize the Pager.
  18. */
  19. public function init();
  20. /**
  21. * Returns the maximum number of results per page.
  22. *
  23. * @return int
  24. */
  25. public function getMaxPerPage();
  26. /**
  27. * Sets the maximum number of results per page.
  28. *
  29. * @param int $max
  30. */
  31. public function setMaxPerPage($max);
  32. /**
  33. * Sets the current page.
  34. *
  35. * @param int $page
  36. */
  37. public function setPage($page);
  38. /**
  39. * Set query.
  40. *
  41. * @param ProxyQueryInterface $query
  42. */
  43. public function setQuery($query);
  44. /**
  45. * Returns an array of results on the given page.
  46. *
  47. * @return array
  48. */
  49. public function getResults();
  50. /**
  51. * Sets the maximum number of page numbers.
  52. *
  53. * @param int $maxPageLinks
  54. */
  55. public function setMaxPageLinks($maxPageLinks);
  56. /**
  57. * Returns the maximum number of page numbers.
  58. *
  59. * @return int
  60. */
  61. public function getMaxPageLinks();
  62. }