diff --git a/src/MySQL.php b/src/MySQL.php index ad1e425..7919cc3 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -150,7 +150,7 @@ return $this; } - // Return SQL LIMIT string from integer or array of [offset => limit] + // SQL LIMIT string public function limit(?int $limit, ?int $offset = null): self { // Unset row limit if null was passed if ($limit === null) { @@ -158,6 +158,12 @@ return $this; } + // Set LIMIT without range directly as integer + if (is_int($limit)) { + $this->limit = $limit; + return $this; + } + // No offset defined, set limit property directly as string if (is_null($offset)) { $this->limit = (string) $limit;