diff --git a/src/Magnetar/Database/QueryBuilder.php b/src/Magnetar/Database/QueryBuilder.php index dbc799d..e40bb58 100644 --- a/src/Magnetar/Database/QueryBuilder.php +++ b/src/Magnetar/Database/QueryBuilder.php @@ -282,12 +282,17 @@ public function unsetOrderBy(): self { /** * Set the limit - * @param int $limit + * @param int $limit The number of rows to return + * @param int|null $offset Optional. The offset to start at. Defaults to null (do not alter offset) * @return self */ - public function limit(int $limit): self { + public function limit(int $limit, int|null $offset=null): self { $this->limit = $limit; + if(null !== $offset) { + return $this->offset($offset); + } + return $this; }