1 | <?php |
||
19 | class Paginator |
||
20 | { |
||
21 | /** |
||
22 | * The callable object this factory is attached to |
||
23 | * |
||
24 | * @var CallableObject |
||
25 | */ |
||
26 | private $xCallable; |
||
27 | |||
28 | /** |
||
29 | * The total number of items |
||
30 | * |
||
31 | * @var integer |
||
32 | */ |
||
33 | private $nItemsTotal = 0; |
||
34 | |||
35 | /** |
||
36 | * The number of items per page |
||
37 | * |
||
38 | * @var integer |
||
39 | */ |
||
40 | private $nItemsPerPage = 0; |
||
41 | |||
42 | /** |
||
43 | * The current page |
||
44 | * |
||
45 | * @var integer |
||
46 | */ |
||
47 | private $nCurrentPage = 0; |
||
48 | |||
49 | /** |
||
50 | * The class constructor |
||
51 | * |
||
52 | * @param CallableObject $xCallable |
||
53 | */ |
||
54 | public function __construct(CallableObject $xCallable) |
||
58 | |||
59 | /** |
||
60 | * Set the paginator properties |
||
61 | * |
||
62 | * @param integer $nItemsTotal the total number of items |
||
63 | * @param integer $nItemsPerPage the number of items per page |
||
64 | * @param integer $nCurrentPage the current page |
||
65 | * |
||
66 | * @return Paginator |
||
67 | */ |
||
68 | public function setProperties($nItemsTotal, $nItemsPerPage, $nCurrentPage) |
||
76 | |||
77 | /** |
||
78 | * Generate the corresponding javascript code for a call to any method |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | public function __call($sMethod, $aArguments) |
||
92 | } |
||
93 |