1 | <?php |
||
20 | class Paginator |
||
21 | { |
||
22 | /** |
||
23 | * The callable object this factory is attached to |
||
24 | * |
||
25 | * @var CallableObject |
||
26 | */ |
||
27 | private $xCallable; |
||
28 | |||
29 | /** |
||
30 | * The total number of items |
||
31 | * |
||
32 | * @var integer |
||
33 | */ |
||
34 | private $nItemsTotal = 0; |
||
35 | |||
36 | /** |
||
37 | * The number of items per page |
||
38 | * |
||
39 | * @var integer |
||
40 | */ |
||
41 | private $nItemsPerPage = 0; |
||
42 | |||
43 | /** |
||
44 | * The current page |
||
45 | * |
||
46 | * @var integer |
||
47 | */ |
||
48 | private $nCurrentPage = 0; |
||
49 | |||
50 | /** |
||
51 | * Create a new Factory instance. |
||
52 | * |
||
53 | * @return void |
||
|
|||
54 | */ |
||
55 | public function __construct(CallableObject $xCallable) |
||
59 | |||
60 | /** |
||
61 | * Set the paginator properties |
||
62 | * |
||
63 | * @param integer $nItemsTotal the total number of items |
||
64 | * @param integer $nItemsPerPage the number of items per page |
||
65 | * @param integer $nCurrentPage the current page |
||
66 | * |
||
67 | * @return Paginator |
||
68 | */ |
||
69 | public function setProperties($nItemsTotal, $nItemsPerPage, $nCurrentPage) |
||
77 | |||
78 | /** |
||
79 | * Generate the corresponding javascript code for a call to any method |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function __call($sMethod, $aArguments) |
||
93 | } |
||
94 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.