diff --git a/src/Model/SimplePaginatedList.php b/src/Model/SimplePaginatedList.php index 6f33e62..f9f9f6f 100644 --- a/src/Model/SimplePaginatedList.php +++ b/src/Model/SimplePaginatedList.php @@ -84,4 +84,19 @@ public function count() return $this->totalRecordCount; } + + /** + * Mutate the pagination limit + * + * @param int $limit Maximum number of items per page (0 - 100) + * @throws \RuntimeException + */ + public function setPaginationLimit($limit) + { + if ((int)$limit < 0 || (int)$limit > 100) { + throw new \RuntimeException('Invalid limit value (0 - 100): '.$limit); + } + $this->limit = (int) $limit; + } + }