PagerInterface.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. interface PagerInterface
  12. {
  13. /**
  14. * Initialize the Pager.
  15. */
  16. public function init();
  17. /**
  18. * Returns the maximum number of results per page.
  19. *
  20. * @return int
  21. */
  22. public function getMaxPerPage();
  23. /**
  24. * Sets the maximum number of results per page.
  25. *
  26. * @param int $max
  27. */
  28. public function setMaxPerPage($max);
  29. /**
  30. * Sets the current page.
  31. *
  32. * @param int $page
  33. */
  34. public function setPage($page);
  35. /**
  36. * Set query.
  37. *
  38. * @param mixed $query
  39. */
  40. public function setQuery($query);
  41. /**
  42. * Returns an array of results on the given page.
  43. *
  44. * @return array
  45. */
  46. public function getResults();
  47. }