1: <?php
2:
3: namespace Charcoal\Source;
4:
5: /**
6: * Pagination Interface.
7: */
8: interface PaginationInterface
9: {
10: /**
11: * @param array $data The pagination data (page, num_per_page).
12: * @return Pagination Chainable
13: */
14: public function setData(array $data);
15:
16: /**
17: * @param integer $page The current page. Starts at 0.
18: * @return Pagination (Chainable)
19: */
20: public function setPage($page);
21:
22: /**
23: * @return integer
24: */
25: public function page();
26:
27: /**
28: * @param integer $num The number ot item to retrieve per page.
29: * @throws InvalidArgumentException If the parameter is not numeric or < 0.
30: * @return Pagination (Chainable)
31: */
32: public function setNumPerPage($num);
33: /**
34: * @return integer
35: */
36: public function numPerPage();
37:
38: /**
39: * @return integer
40: */
41: public function first();
42:
43: /**
44: * Can be greater than the actual number of items to retrieve.
45: * @return integer
46: */
47: public function last();
48: }
49: