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