PagerInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * This file is part of the Sonata 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. */
  11. namespace Sonata\AdminBundle\Datagrid;
  12. interface PagerInterface
  13. {
  14. /**
  15. * Initialize the Pager.
  16. *
  17. * @return void
  18. */
  19. public function init();
  20. /**
  21. * Returns the maximum number of results per page.
  22. *
  23. * @return integer
  24. */
  25. public function getMaxPerPage();
  26. /**
  27. * Sets the maximum number of results per page.
  28. *
  29. * @param integer $max
  30. */
  31. public function setMaxPerPage($max);
  32. /**
  33. * Sets the current page.
  34. *
  35. * @param integer $page
  36. */
  37. public function setPage($page);
  38. /**
  39. * Set query
  40. *
  41. * @param mixed $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. }