| 1 | <?php |
||
| 24 | trait LimitableTrait |
||
| 25 | { |
||
| 26 | |||
| 27 | private $_limit = null; |
||
| 28 | private $_offset = null; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Set linit |
||
| 32 | * Multiple calls will overrride previous value of limit |
||
| 33 | * |
||
| 34 | * @param integer $limit limit |
||
| 35 | * @return CriteriaInterface |
||
| 36 | */ |
||
| 37 | 1 | public function limit($limit) |
|
| 38 | { |
||
| 39 | 1 | $this->_limit = intval($limit); |
|
| 40 | 1 | return $this; |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Set offset |
||
| 45 | * Multiple calls will override previous value |
||
| 46 | * |
||
| 47 | * @return CriteriaInterface |
||
| 48 | */ |
||
| 49 | 1 | public function offset($offset) |
|
| 50 | { |
||
| 51 | 1 | $this->_offset = intval($offset); |
|
| 52 | 1 | return $this; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @since v1.0 |
||
| 57 | */ |
||
| 58 | 51 | public function getLimit() |
|
| 62 | |||
| 63 | /** |
||
| 64 | |||
| 65 | * @return CriteriaInterface |
||
| 66 | */ |
||
| 67 | 1 | public function setLimit($limit) |
|
| 68 | { |
||
| 69 | 1 | $this->limit($limit); |
|
| 70 | 1 | return $this; |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return CriteriaInterface |
||
| 75 | */ |
||
| 76 | 51 | public function getOffset() |
|
| 80 | |||
| 81 | /** |
||
| 82 | * @since v1.0 |
||
| 83 | */ |
||
| 84 | 1 | public function setOffset($offset) |
|
| 89 | |||
| 90 | } |
||
| 91 |