| @@ 31-38 (lines=8) @@ | ||
| 28 | * @param \SS_HTTPRequest $request |
|
| 29 | * @return int the offset value |
|
| 30 | */ |
|
| 31 | public function offset($request) { |
|
| 32 | $offset = (int)$request->getVar('offset'); |
|
| 33 | if($offset && is_int($offset) && $offset >= 0) { |
|
| 34 | return $offset; |
|
| 35 | } else { |
|
| 36 | return static::$default_offset; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Returns the limit, either given in request by `limit` or from the default settings in the controller. |
|
| @@ 46-53 (lines=8) @@ | ||
| 43 | * @param \SS_HTTPRequest $request |
|
| 44 | * @return int the limit value |
|
| 45 | */ |
|
| 46 | public function limit($request) { |
|
| 47 | $limit = (int)$request->getVar('limit'); |
|
| 48 | if($limit && is_int($limit) && $limit > 0) { |
|
| 49 | return $limit; |
|
| 50 | } else { |
|
| 51 | return static::$default_limit; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | } |
|