| 1 | <?php |
||
| 23 | trait LimitableTrait |
||
| 24 | { |
||
| 25 | |||
| 26 | private $_limit = null; |
||
| 27 | private $_offset = null; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set limit |
||
| 31 | * Multiple calls will overrride previous value of limit. |
||
| 32 | * |
||
| 33 | * Pass `false` to disable limit. |
||
| 34 | * |
||
| 35 | * @param integer|bool $limit limit |
||
| 36 | * @return static |
||
| 37 | */ |
||
| 38 | 1 | public function limit($limit) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Set offset |
||
| 51 | * Multiple calls will override previous value |
||
| 52 | * |
||
| 53 | * Pass `false` to disable offset. |
||
| 54 | * |
||
| 55 | * @return static |
||
| 56 | */ |
||
| 57 | 1 | public function offset($offset) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * @since v1.0 |
||
| 70 | */ |
||
| 71 | 82 | public function getLimit() |
|
| 75 | |||
| 76 | /** |
||
| 77 | |||
| 78 | * @return static |
||
| 79 | */ |
||
| 80 | 1 | public function setLimit($limit) |
|
| 85 | |||
| 86 | /** |
||
| 87 | * @return static |
||
| 88 | */ |
||
| 89 | 82 | public function getOffset() |
|
| 93 | |||
| 94 | /** |
||
| 95 | * @since v1.0 |
||
| 96 | */ |
||
| 97 | 1 | public function setOffset($offset) |
|
| 102 | |||
| 103 | } |
||
| 104 |