1 | <?php |
||
13 | class LimitStatement extends Statement |
||
14 | { |
||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | protected $limit; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $offset = 0; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $max = 1; |
||
29 | |||
30 | /** |
||
31 | * @param $max maximum # the limit can be set to, 0=infinity |
||
32 | */ |
||
33 | public function __construct($max = 0) |
||
37 | |||
38 | /** |
||
39 | * Sets the limit. |
||
40 | * |
||
41 | * @param int $limit |
||
42 | * @param int $offset |
||
43 | * |
||
44 | * @return self |
||
45 | */ |
||
46 | public function setLimit($limit, $offset = 0) |
||
55 | |||
56 | /** |
||
57 | * Gets the start offset. |
||
58 | * |
||
59 | * @return int |
||
60 | */ |
||
61 | public function getStart() |
||
65 | |||
66 | /** |
||
67 | * Gets the limit. |
||
68 | * |
||
69 | * @return array limit |
||
70 | */ |
||
71 | public function getLimit() |
||
79 | |||
80 | public function build() |
||
92 | } |
||
93 |