PagerInterface.php 1.4 KB

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